`
yuanlanjun
  • 浏览: 1188111 次
文章分类
社区版块
存档分类
最新评论

.net 中AD校验密码

 
阅读更多
public string CheckDomainUser(string uid, string pwd)
{
string flag1 = "false";
try
{
if (pwd == null || pwd.Trim().Length == 0)
{
return flag1;
}
string sPath = "LDAP://shanghai-air.com";
DirectoryEntry entry1 = new DirectoryEntry(sPath, uid, pwd, AuthenticationTypes.ServerBind);
object obj1 = System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(entry1.NativeObject);
flag1 = "true";
}
catch
{
flag1 = "false";
}
return flag1;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics