Hi, I am using Visual Basic6.0. I am having a login form where username and
password are stored in database. But i want to use the active directory
information
to login into the project. I don't want the user to have separate login for
the projects.
You have to ways of doing this, using DirectoryServices or ActiveDs. Here is
a sample code of how you can connect to your active directory using
DirectoryServices
Dim x As Object
Dim i As Integer
Dim User As New
System.DirectoryServices.DirectoryEntry("LDAP://xxx.xxx.xxx.255/CN=user,OU=Venezuela,OU=Sales,DC=company, DC=com")
Dim entry As DirectoryServices.DirectoryEntry
Dim mySearcher As New
System.DirectoryServices.DirectorySearcher(entry)
Dim result As System.DirectoryServices.SearchResult
If TextNombre.Text = "" Then Exit Sub
i = 0
mySearcher.Filter = ("(anr=" & TextNombre.Text & ")")
ListBox1.Items.Clear()
For Each result In mySearcher.FindAll()
ListBox1.Items.Add(result.GetDirectoryEntry().Path)
User = result.GetDirectoryEntry
Do While i < User.Properties.Count
x = User.Properties.Item(i)
i += 1
Loop
ListBox1.Items.Add(User.Properties.Item("sn")) '
User.Properties("HomeNumber")(0))
'Para que sean realizados los cambios
'User.CommitChanges()
'-------------------------------------
Next
I hope this can give you a hint where to start looking for the
authentication part.
JMP
> Hi, I am using Visual Basic6.0. I am having a login form where username and
> password are stored in database. But i want to use the active directory
> information
> to login into the project. I don't want the user to have separate login for
> the projects.
shankar - 31 Mar 2005 10:15 GMT
Thanx.
> You have to ways of doing this, using DirectoryServices or ActiveDs. Here is
> a sample code of how you can connect to your active directory using
[quoted text clipped - 38 lines]
> > to login into the project. I don't want the user to have separate login for
> > the projects.