Abstractions.WindowsApi.pInvokes.ValidateUser C# (CSharp) Метод

ValidateUser() публичный статический Метод

Attempts to validate the user's credentials using a pInvoke to LogonUser but ignores password change response.
public static ValidateUser ( string username, string domain, string password ) : bool
username string The username
domain string The domain
password string The password
Результат bool
        public static bool ValidateUser(string username, string domain, string password)
        {
            int ret = LogonUser(username, domain, password);
            // ERROR_PASSWORD_EXPIRED 1330
            // ERROR_PASSWORD_MUST_CHANGE 1907
            // ERROR_PASSWORD_CHANGE_REQUIRED 1938
            if (new int[] { 0, 1330, 1907, 1938 }.Any(a => a == ret))
            {
                return true;
            }

            return false;
        }