lstbox1.Items.Clear();
DirectoryEntry myOU = new DirectoryEntry("LDAP://DC=msbu,DC=sharepoint,DC=com");DirectorySearcher userSearcher = new DirectorySearcher(myOU);//userSearcher.Filter = "(objectClass=user)";userSearcher.Filter = String.Format("( &(objectClass=user) (name={0}))", txtUserName.Text.Trim() + "*");//Label1.Text = userSearcher.FindAll().Count.ToString ();
{
lstbox1.Items.Add(
}foreach (SearchResult srchresult in userSearcher.FindAll())if (srchresult.Properties["name"].Count > 0)new ListItem(Convert.ToString(srchresult.Properties["name"][0])));
DirectoryEntry myOU = new DirectoryEntry("LDAP://DC=msbu,DC=sharepoint,DC=com");DirectorySearcher userSearcher = new DirectorySearcher(myOU);//userSearcher.Filter = "(objectClass=user)";userSearcher.Filter = String.Format("( &(objectClass=user) (name={0}))", txtUserName.Text.Trim() + "*");//Label1.Text = userSearcher.FindAll().Count.ToString ();
{
lstbox1.Items.Add(
}foreach (SearchResult srchresult in userSearcher.FindAll())if (srchresult.Properties["name"].Count > 0)new ListItem(Convert.ToString(srchresult.Properties["name"][0])));
this coding is not in proper...
ReplyDelete