一个简单的测试域账户登陆的工具,可奇怪的的是有个别账户登陆不上,显示“无效用户名或密码错误”。但这个别账号自己登陆域账号没问题,很奇怪这是为什么?主代码如下,(应该不是代码问题吧,毕竟大多数用户都是成功登陆的)。string Sernames = textBox3.Text; /// "LDAP:*****";
try
{
DirectoryEntry _DirectoryEntry = new DirectoryEntry(Sernames, textBox1.Text.Trim(), textBox2.Text.Trim(), AuthenticationTypes.None);
string selName = _DirectoryEntry.Name;
string Path = _DirectoryEntry.Path;
MessageBox.Show("测试成功,Name=" + selName + ",Path=" + Path);
}
catch (Exception ex )
{ MessageBox.Show(ex.Message);
}
try
{
DirectoryEntry _DirectoryEntry = new DirectoryEntry(Sernames, textBox1.Text.Trim(), textBox2.Text.Trim(), AuthenticationTypes.None);
string selName = _DirectoryEntry.Name;
string Path = _DirectoryEntry.Path;
MessageBox.Show("测试成功,Name=" + selName + ",Path=" + Path);
}
catch (Exception ex )
{ MessageBox.Show(ex.Message);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货