GSF.Identity.UserInfo.SetLocalUserPassword C# (CSharp) Méthode

SetLocalUserPassword() public static méthode

Sets local user's password.
or was null. No was specified or user does not exist. Could not set password for local user.
public static SetLocalUserPassword ( string userName, string password ) : void
userName string User name to change password for.
password string New password fro user.
Résultat void
        public static void SetLocalUserPassword(string userName, string password)
        {
            if ((object)userName == null)
                throw new ArgumentNullException(nameof(userName));

            if ((object)password == null)
                throw new ArgumentNullException(nameof(password));

            // Remove any irrelevant white space
            userName = userName.Trim();

            if (userName.Length == 0)
                throw new ArgumentException("Cannot set password for local user: no user name was specified.", nameof(userName));

            if (Common.IsPosixEnvironment)
                UnixUserInfo.SetLocalUserPassword(userName, password);

            WindowsUserInfo.SetLocalUserPassword(userName, password);
        }