public static bool IsUserValid(string ADPath, string UserName, string Password)
{
System.DirectoryServices.DirectoryEntry de = new System.DirectoryServices.DirectoryEntry(ADPath, UserName, Password, System.DirectoryServices.AuthenticationTypes.Secure);
try
{
Object native = de.NativeObject;
return true;
}
catch
{
return false;
}
}
{
System.DirectoryServices.DirectoryEntry de = new System.DirectoryServices.DirectoryEntry(ADPath, UserName, Password, System.DirectoryServices.AuthenticationTypes.Secure);
try
{
Object native = de.NativeObject;
return true;
}
catch
{
return false;
}
}