public bool UserExists(string UserName)
{
DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.MachineName);
foreach (DirectoryEntry child in directoryEntry.Children)
{
if (child.SchemaClassName == "User")
{
if (child.Name == UserName)
return false;
}
}
return true;
}
No comments:
Post a Comment