예제 #1
0
 public void SetInformation(NetUserInformation information, string serverName = null)
 {
     var userInfo1 = new UserInfo1(information);
     uint parameterErrorIndex;
     var result = NativeMethods.NetUserSetInfo(serverName, information.Username, 1, ref userInfo1, out parameterErrorIndex);
     if (result != SystemErrorCode.ErrorSuccess)
     {
         throw ErrorHelper.GetWin32Exception(result);
     }
 }
예제 #2
0
        public void SetInformation(NetUserInformation information, string serverName = null)
        {
            var  userInfo1 = new UserInfo1(information);
            uint parameterErrorIndex;
            var  result = NativeMethods.NetUserSetInfo(serverName, information.Username, 1, ref userInfo1, out parameterErrorIndex);

            if (result != SystemErrorCode.ErrorSuccess)
            {
                throw ErrorHelper.GetWin32Exception(result);
            }
        }
예제 #3
0
 public UserInfo1(NetUserInformation userInformation)
 {
     Name          = userInformation.Username;
     Password      = userInformation.Password;
     PasswordAge   = userInformation.PasswordAge;
     Privilege     = userInformation.Privilege;
     HomeDirectory = userInformation.HomeDirectory;
     Comment       = userInformation.Comment;
     Flags         = userInformation.Flags;
     ScriptPath    = userInformation.ScriptPath;
 }
예제 #4
0
 public UserInfo1(NetUserInformation userInformation)
 {
     Name = userInformation.Username;
     Password = userInformation.Password;
     PasswordAge = userInformation.PasswordAge;
     Privilege = userInformation.Privilege;
     HomeDirectory = userInformation.HomeDirectory;
     Comment = userInformation.Comment;
     Flags = userInformation.Flags;
     ScriptPath = userInformation.ScriptPath;
 }