string ldapPath = "LDAP://corp.
string domianStr = Environment.UserDomainName.ToString();
string domainAndUsername = Environment.UserDomainName + "\\" + Environment.UserName;
DirectoryEntry entry = new DirectoryEntry(ldapPath, domainAndUsername, txtPassword.Text);
DirectorySearcher search = new DirectorySearcher(entry);
SearchResult result = search.FindOne();
Response.Redirect("MainGet.aspx");
//获取域中获取不到密码,所以我也不知道怎么,我给的这段代码是能获取到不用输帐号的登录
//其实我也在这比较迷茫,希望这个是给你点灵感,然后,你把这个作出来再帮助我一下,嘻嘻