Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[LOGICIEL] Impossible de récupérer le nom des groupes

Featured Replies

Posté(e)

Bonjour,

je suis occupé à faire un site internet. Pour la sécurité, j'ai besoin de récupérer le nom du groupe auquel appartient l'utilisateur. Mais je n'y arrive pas!

Voici mon code:

Imports System.DirectoryServices
Imports System.Data.SqlClient
Imports System.Text
Imports System.Collections



Public Class index
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub
Protected WithEvents lLogin As System.Web.UI.WebControls.Label
Protected WithEvents tblogin As System.Web.UI.WebControls.TextBox
Protected WithEvents lPassword As System.Web.UI.WebControls.Label
Protected WithEvents tbpassword As System.Web.UI.WebControls.TextBox
Protected WithEvents lDomaine As System.Web.UI.WebControls.Label
Protected WithEvents tbDomaine As System.Web.UI.WebControls.TextBox
Protected WithEvents bLogin As System.Web.UI.WebControls.Button
Protected WithEvents lNom As System.Web.UI.WebControls.Label
Protected WithEvents lPrenom As System.Web.UI.WebControls.Label
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents lError As System.Web.UI.WebControls.Label

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
	'CODEGEN: This method call is required by the Web Form Designer
	'Do not modify it using the code editor.
	InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

Public Function Log(ByVal username As String, ByVal password As String)
	Dim nom, prenom, test, jour, mois, annee, heure, minute, seconde As String
	Dim compteur As Integer
	Dim datenow As String
	Dim MyConnection As SqlConnection
	Try
		Dim path As String = "LDAP://192.168.81.128"
		Dim entry As DirectoryEntry = New DirectoryEntry(path, username, password)
		Dim searcher As DirectorySearcher = New DirectorySearcher(entry)
		searcher.Filter = "(SAMAccountName=" & username & ")"
		Dim result As SearchResult
		result = searcher.FindOne()
		entry = result.GetDirectoryEntry
		searcher.PropertiesToLoad.Add("memberOf")
		test = Trim(CStr(result.Properties("membreOf")(0)))
		System.Diagnostics.Debug.WriteLine("Le groupe est: " & test)
		Log = True
	Catch e As Exception
		System.Diagnostics.Debug.WriteLine("Erreur lors de la recherche: ")
		System.Diagnostics.Debug.WriteLine(e)
		Log = False
	End Try

End Class

L'erreur est:

Object reference not set to an instance of an object.

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.