Hi,
In order to fill a listbox from active directory you should try this:
string path; //this is the ldap path you want to use
DirectoryEntry AD = new DirectoryEntry(path);
DirectorySearcher mySearcher = new DirectorySearcher(AD);
mySearcher.Filter = ("(objectClass=user)");
foreach(SearchResult result in
mySearcher.FindAll())
{
listbox1.items.add(result.Tostring());
}
This should help you a long.
Regards,
Alcapone
|