GSF.Identity.UserInfo.LocalUserExists C# (CSharp) Method

LocalUserExists() public static method

Determines if local user exists.
was null. No was specified.
public static LocalUserExists ( string userName ) : bool
userName string User name to test for existence.
return bool
        public static bool LocalUserExists(string userName)
        {
            if ((object)userName == null)
                throw new ArgumentNullException(nameof(userName));

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

            if (userName.Length == 0)
                throw new ArgumentException("No user name was specified.", nameof(userName));

            if (Common.IsPosixEnvironment)
                return UnixUserInfo.LocalUserExists(userName);

            return WindowsUserInfo.LocalUserExists(userName);
        }