private string IsConnected(string domainName, string userName, string userPwd)
{
DirectoryEntry domain = new DirectoryEntry();
try
{
domain.Path = string.Format("LDAP://{0}", domainName);
domain.Username = userName;
domain.Password = userPwd;
domain.AuthenticationType = AuthenticationTypes.Secure;
domain.RefreshCache();
return "通过";
}
catch (Exception ex)
{
return ex.Message;
}
}
判断用户名、密码是否可以连接到windows域
最新推荐文章于 2020-12-30 13:20:28 发布