NetUserGetLocalGroups
权限问题不知道。

解决方案 »

  1.   

    先谢谢 NowCan(能量、激情、雨水、彩虹——雷雨云)但是没有办法知道权限吗?各位?
      

  2.   

    用NetUserGetInfo(),将level设为1,可查询该用户的权限。
    详细信息请查MSDN。USER_INFO_1
    The USER_INFO_1 structure contains information about a user account, including account name, password data, privilege level, and the path to the user's home directory. typedef struct _USER_INFO_1 {
      LPWSTR    usri1_name;
      LPWSTR    usri1_password;
      DWORD     usri1_password_age;
      DWORD     usri1_priv;
      LPWSTR    usri1_home_dir;
      LPWSTR    usri1_comment;
      DWORD     usri1_flags;
      LPWSTR    usri1_script_path;
    }USER_INFO_1, *PUSER_INFO_1, *LPUSER_INFO_1;
    Members
    usri1_name 
    Pointer to a Unicode string that specifies the name of the user account. For the NetUserSetInfo function, this member is ignored. 
    usri1_password 
    Pointer to a Unicode string that specifies the password of the user indicated by the usri1_name member. The length cannot exceed PWLEN bytes. The NetUserEnum and NetUserGetInfo functions return a NULL pointer to maintain password security. 
    By convention, Windows NT/Windows 2000 limits the length of passwords to LM20_PWLEN characters. This convention allows LAN Manager, Windows 3.x, Windows for Workgroups 3.x, Windows 95, and Windows 98 clients to access a Windows NT/Windows 2000 server using the account. usri1_password_age 
    Specifies a DWORD value that indicates the number of seconds that have elapsed since the usri1_password member was last changed. The NetUserAdd and NetUserSetInfo functions ignore this member. 
    usri1_priv 
    Specifies a DWORD value that indicates the level of privilege assigned to the usri1_name member. When you call the NetUserAdd function, this member must be USER_PRIV_USER. When you call the NetUserSetInfo function, this member must be the value returned by the NetUserGetInfo function or the NetUserEnum function. This member can be one of the following values.