protected bool verifyUserAccount(string computerName, string userName, string password) { bool flag = false; using (PrincipalContext context = new PrincipalContext(ContextType.Machine, computerName, userName, password)) { flag = context.ValidateCredentials(userName, password); } return flag; }
Then the above snippet can really verify local windows account and password!
No comments:
Post a Comment