Abstractions.WindowsApi.pInvokes.UserMod C# (CSharp) 메소드

UserMod() 공개 정적인 메소드

modify local user settings based on a USER_INFO_4 struct based on http://social.msdn.microsoft.com/forums/en-us/csharpgeneral/thread/B70B79D9-971F-4D6F-8462-97FC126DE0AD
public static UserMod ( string username, structenums userInfo4 ) : Boolean
username string
userInfo4 structenums
리턴 Boolean
        public static Boolean UserMod(string username, structenums.USER_INFO_4 userInfo4)
        {
            Int32 ret = 1;

            SafeNativeMethods.NetUserSetInfo(null, username, 4, ref userInfo4, out ret);
            if (ret != 0) // If the call fails we get a non-zero value
            {
                LibraryLogging.Error("NetUserSetInfo error:{0} {1}", ret, LastError());
                return false;
            }

            return true;
        }