好了,谢谢,不过要加以下单元好像在 域用户下无法检该信息unit NetApi32;interfaceusesWindows;ConstNetApi32DLL='NetApi32.DLL';NERR_Success =0;NERR_BASE =2100;_1L =$FFFFFFFF; //对应于C中的((unsigned long) -1L)NERR_UserExists=NERR_BASE+124;//NT常量DOMAIN_GROUP_RID_ADMINS =$00000200;DOMAIN_GROUP_RID_USERS =$00000201;DOMAIN_GROUP_RID_GUESTS =$00000202;DOMAIN_GROUP_RID_COMPUTERS =$00000203;DOMAIN_GROUP_RID_CONTROLLERS =$00000204;DOMAIN_GROUP_RID_CERT_ADMINS =$00000205;DOMAIN_GROUP_RID_SCHEMA_ADMINS =$00000206;//局域网常量//来自lmcons.hCNLEN =15; // Computer name lengthLM20_CNLEN =15; // LM 2.0 Computer name lengthDNLEN =CNLEN; // Maximum domain name lengthLM20_DNLEN =LM20_CNLEN; // LM 2.0 Maximum domain name lengthUNCLEN =(CNLEN+2); // UNC computer name lengthLM20_UNCLEN =(LM20_CNLEN+2); // LM 2.0 UNC computer name lengthNNLEN =80; // Net name length (share name)LM20_NNLEN =12; // LM 2.0 Net name lengthRMLEN =(UNCLEN+1+NNLEN); // Max remote name lengthLM20_RMLEN =(LM20_UNCLEN+1+LM20_NNLEN); // LM 2.0 Max remote name lengthSNLEN =80 ; // Service name lengthLM20_SNLEN =15 ; // LM 2.0 Service name lengthSTXTLEN =256 ; // Service text lengthLM20_STXTLEN=63 ; // LM 2.0 Service text lengthPATHLEN =256 ; // Max. path (not including drive name)LM20_PATHLEN=256; // LM 2.0 Max. pathDEVLEN =80; // Device name lengthLM20_DEVLEN =8; // LM 2.0 Device name lengthEVLEN =16; // Event name length// User, Group and Password lengthsUNLEN =256; // Maximum user name lengthLM20_UNLEN =20; // LM 2.0 Maximum user name lengthGNLEN =UNLEN; // Group nameLM20_GNLEN =LM20_UNLEN ; // LM 2.0 Group namePWLEN =256 ; // Maximum password lengthLM20_PWLEN =14; // LM 2.0 Maximum password lengthSHPWLEN =8 ; // Share password length (bytes)CLTYPE_LEN =12; // Length of client type stringMAXCOMMENTSZ =256; // Multipurpose comment lengthLM20_MAXCOMMENTSZ =48; // LM 2.0 Multipurpose comment lengthQNLEN =NNLEN; // Queue name maximum lengthLM20_QNLEN =LM20_NNLEN ; // LM 2.0 Queue name maximum lengthALERTSZ =128 ; // size of alert string in serverMAXDEVENTRIES =32; // Max number of device entriesNETBIOS_NAME_LEN =16; // NetBIOS net name (bytes)MAX_PREFERRED_LENGTH =$FFFFFFFF;CRYPT_KEY_LEN =7;CRYPT_TXT_LEN =8;ENCRYPTED_PWLEN =16 ;SESSION_PWLEN =24;SESSION_CRYPT_KLEN =21;PARM_ERROR_UNKNOWN =$FFFFFFFF;PARM_ERROR_NONE =0;PARMNUM_BASE_INFOLEVEL =1000;PLATFORM_ID_DOS =300;PLATFORM_ID_OS2 =400;PLATFORM_ID_NT =500;PLATFORM_ID_OSF =600;PLATFORM_ID_VMS =700;// There message numbers assigned to different LANMAN components// are as defined below.//// lmerr.h: 2100 - 2999 NERR_BASE// alertmsg.h: 3000 - 3049 ALERT_BASE// lmsvc.h: 3050 - 3099 SERVICE_BASE// lmerrlog.h: 3100 - 3299 ERRLOG_BASE// msgtext.h: 3300 - 3499 MTXT_BASE// apperr.h: 3500 - 3999 APPERR_BASE// apperrfs.h: 4000 - 4299 APPERRFS_BASE// apperr2.h: 4300 - 5299 APPERR2_BASE// ncberr.h: 5300 - 5499 NRCERR_BASE// alertmsg.h: 5500 - 5599 ALERT2_BASE// lmsvc.h: 5600 - 5699 SERVICE2_BASE// lmerrlog.h 5700 - 5799 ERRLOG2_BASEMIN_LANMAN_MESSAGE_ID =NERR_BASE;MAX_LANMAN_MESSAGE_ID =5799;//关于user的常量 Bit masks for field usriX_flags of USER_INFO_X (X = 0/1).UF_SCRIPT =$0001;UF_ACCOUNTDISABLE =$0002;UF_HOMEDIR_REQUIRED =$0008;UF_LOCKOUT =$0010;UF_PASSWD_NOTREQD =$0020;UF_PASSWD_CANT_CHANGE =$0040;// Account type bits as part of usri_flags.UF_TEMP_DUPLICATE_ACCOUNT =$0100;UF_NORMAL_ACCOUNT =$0200;UF_INTERDOMAIN_TRUST_ACCOUNT =$0800;UF_WORKSTATION_TRUST_ACCOUNT =$1000;UF_SERVER_TRUST_ACCOUNT =$2000;UF_MACHINE_ACCOUNT_MASK=UF_INTERDOMAIN_TRUST_ACCOUNT or UF_WORKSTATION_TRUST_ACCOUNT or UF_SERVER_TRUST_ACCOUNT;UF_ACCOUNT_TYPE_MASK=UF_TEMP_DUPLICATE_ACCOUNT or UF_NORMAL_ACCOUNT or UF_INTERDOMAIN_TRUST_ACCOUNT or UF_WORKSTATION_TRUST_ACCOUNT or UF_SERVER_TRUST_ACCOUNT;UF_DONT_EXPIRE_PASSWD =$10000;UF_MNS_LOGON_ACCOUNT =$20000;UF_SETTABLE_BITS = UF_SCRIPT or UF_ACCOUNTDISABLE or UF_LOCKOUT or UF_HOMEDIR_REQUIRED orUF_PASSWD_NOTREQD or UF_PASSWD_CANT_CHANGE or UF_ACCOUNT_TYPE_MASK orUF_DONT_EXPIRE_PASSWD or UF_MNS_LOGON_ACCOUNT ;// bit masks for the NetUserEnum filter parameter.FILTER_TEMP_DUPLICATE_ACCOUNT =$0001;FILTER_NORMAL_ACCOUNT =$0002;// FILTER_PROXY_ACCOUNT =$0004;FILTER_INTERDOMAIN_TRUST_ACCOUNT =$0008;FILTER_WORKSTATION_TRUST_ACCOUNT =$0010;FILTER_SERVER_TRUST_ACCOUNT =$0020;// bit masks for the NetUserGetLocalGroups flagsLG_INCLUDE_INDIRECT =$0001;// Bit masks for field usri2_auth_flags of USER_INFO_2.AF_OP_PRINT =$1;AF_OP_COMM =$2;AF_OP_SERVER =$4;AF_OP_ACCOUNTS =$8;AF_SETTABLE_BITS =AF_OP_PRINT or AF_OP_COMM or AF_OP_SERVER or AF_OP_ACCOUNTS;// UAS role manifests under NETLOGONUAS_ROLE_STANDALONE =0;UAS_ROLE_MEMBER =1;UAS_ROLE_BACKUP =2;UAS_ROLE_PRIMARY =3;// Values for ParmError for NetUserSetInfo.USER_NAME_PARMNUM =1;USER_PASSWORD_PARMNUM =3;USER_PASSWORD_AGE_PARMNUM =4;USER_PRIV_PARMNUM =5;USER_HOME_DIR_PARMNUM =6;USER_COMMENT_PARMNUM =7;USER_FLAGS_PARMNUM =8;USER_SCRIPT_PATH_PARMNUM =9;USER_AUTH_FLAGS_PARMNUM =10;USER_FULL_NAME_PARMNUM =11;USER_USR_COMMENT_PARMNUM =12;USER_PARMS_PARMNUM =13;USER_WORKSTATIONS_PARMNUM =14;USER_LAST_LOGON_PARMNUM =15;USER_LAST_LOGOFF_PARMNUM =16;USER_ACCT_EXPIRES_PARMNUM =17;USER_MAX_STORAGE_PARMNUM =18;USER_UNITS_PER_WEEK_PARMNUM =19;USER_LOGON_HOURS_PARMNUM =20;USER_PAD_PW_COUNT_PARMNUM =21;USER_NUM_LOGONS_PARMNUM =22;USER_LOGON_SERVER_PARMNUM =23;USER_COUNTRY_CODE_PARMNUM =24;USER_CODE_PAGE_PARMNUM =25;USER_PRIMARY_GROUP_PARMNUM =51;USER_PROFILE =52; // ?? Delete when convenientUSER_PROFILE_PARMNUM =52;USER_HOME_DIR_DRIVE_PARMNUM =53;// the new infolevel counterparts of the old info level + parmnumUSER_NAME_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_NAME_PARMNUM;USER_PASSWORD_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_PARMNUM;USER_PASSWORD_AGE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_AGE_PARMNUM;USER_PRIV_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_PRIV_PARMNUM;USER_HOME_DIR_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_PARMNUM;USER_COMMENT_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_COMMENT_PARMNUM;USER_FLAGS_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_FLAGS_PARMNUM;USER_SCRIPT_PATH_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_SCRIPT_PATH_PARMNUM;USER_AUTH_FLAGS_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_AUTH_FLAGS_PARMNUM;USER_FULL_NAME_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_FULL_NAME_PARMNUM;USER_USR_COMMENT_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_USR_COMMENT_PARMNUM;USER_PARMS_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_PARMS_PARMNUM;USER_WORKSTATIONS_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_WORKSTATIONS_PARMNUM;USER_LAST_LOGON_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGON_PARMNUM;USER_LAST_LOGOFF_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGOFF_PARMNUM;USER_ACCT_EXPIRES_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_ACCT_EXPIRES_PARMNUM;USER_MAX_STORAGE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_MAX_STORAGE_PARMNUM;USER_UNITS_PER_WEEK_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_UNITS_PER_WEEK_PARMNUM;USER_LOGON_HOURS_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_LOGON_HOURS_PARMNUM;USER_PAD_PW_COUNT_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_PAD_PW_COUNT_PARMNUM;USER_NUM_LOGONS_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_NUM_LOGONS_PARMNUM;USER_LOGON_SERVER_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_LOGON_SERVER_PARMNUM;USER_COUNTRY_CODE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_COUNTRY_CODE_PARMNUM;USER_CODE_PAGE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_CODE_PAGE_PARMNUM;USER_PRIMARY_GROUP_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_PRIMARY_GROUP_PARMNUM;//USER_POSIX_ID_PARMNUM未明,在VC中找不到//USER_POSIX_ID_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_POSIX_ID_PARMNUM;USER_HOME_DIR_DRIVE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_DRIVE_PARMNUM;// For SetInfo call (parmnum 0) when password change not requiredNULL_USERSETINFO_PASSWD =' ';TIMEQ_FOREVER =_1L; //((unsigned long) -1L)USER_MAXSTORAGE_UNLIMITED =_1L; //((unsigned long) -1L)USER_NO_LOGOFF =_1L; //((unsigned long) -1L)UNITS_PER_DAY =24;UNITS_PER_WEEK =UNITS_PER_DAY * 7;// Privilege levels (USER_INFO_X field usriX_priv (X = 0/1)).USER_PRIV_MASK =$3;USER_PRIV_GUEST =0;USER_PRIV_USER =1;USER_PRIV_ADMIN =2;// user modals related defaultsMAX_PASSWD_LEN =PWLEN;DEF_MIN_PWLEN =6;DEF_PWUNIQUENESS =5;DEF_MAX_PWHIST =8;DEF_MAX_PWAGE =TIMEQ_FOREVER; // foreverDEF_MIN_PWAGE =0; // 0 daysDEF_FORCE_LOGOFF =$ffffffff; // neverDEF_MAX_BADPW =0 ; // no limitONE_DAY =01*24*3600; // 01 day// User Logon Validation (codes returned)VALIDATED_LOGON =0;PASSWORD_EXPIRED =2;NON_VALIDATED_LOGON =3;VALID_LOGOFF =1;// parmnum manifests for user modalsMODALS_MIN_PASSWD_LEN_PARMNUM =1;MODALS_MAX_PASSWD_AGE_PARMNUM =2;MODALS_MIN_PASSWD_AGE_PARMNUM =3;MODALS_FORCE_LOGOFF_PARMNUM =4;MODALS_PASSWD_HIST_LEN_PARMNUM =5;MODALS_ROLE_PARMNUM =6;MODALS_PRIMARY_PARMNUM =7;MODALS_DOMAIN_NAME_PARMNUM =8;MODALS_DOMAIN_ID_PARMNUM =9;MODALS_LOCKOUT_DURATION_PARMNUM =10;MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM =11;MODALS_LOCKOUT_THRESHOLD_PARMNUM =12;// the new infolevel counterparts of the old info level + parmnumMODALS_MIN_PASSWD_LEN_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_LEN_PARMNUM;MODALS_MAX_PASSWD_AGE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_MAX_PASSWD_AGE_PARMNUM;MODALS_MIN_PASSWD_AGE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_AGE_PARMNUM;MODALS_FORCE_LOGOFF_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_FORCE_LOGOFF_PARMNUM;MODALS_PASSWD_HIST_LEN_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_PASSWD_HIST_LEN_PARMNUM;MODALS_ROLE_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_ROLE_PARMNUM;MODALS_PRIMARY_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_PRIMARY_PARMNUM;MODALS_DOMAIN_NAME_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_NAME_PARMNUM;MODALS_DOMAIN_ID_INFOLEVEL =PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM;//组常量MAXPERMENTRIES =64;ACCESS_NONE =0;ACCESS_READ =$01;ACCESS_WRITE =$02;ACCESS_CREATE =$04;ACCESS_EXEC =$08;ACCESS_DELETE =$10;ACCESS_ATRIB =$20;ACCESS_PERM =$40;ACCESS_GROUP =$8000;// Bit values for the acc1_attr field of the ACCESS_INFO_1 structure.ACCESS_AUDIT =$1;ACCESS_SUCCESS_OPEN =$10;ACCESS_SUCCESS_WRITE =$20;ACCESS_SUCCESS_DELETE =$40;ACCESS_SUCCESS_ACL =$80;ACCESS_SUCCESS_MASK =$F0;ACCESS_FAIL_OPEN =$100;ACCESS_FAIL_WRITE =$200;ACCESS_FAIL_DELETE =$400;ACCESS_FAIL_ACL =$800;ACCESS_FAIL_MASK =$F00;ACCESS_FAIL_SHIFT =4;// Parmnum value for NetAccessSetInfo.ACCESS_RESOURCE_NAME_PARMNUM =1;ACCESS_ATTR_PARMNUM =2;ACCESS_COUNT_PARMNUM =3;ACCESS_ACCESS_LIST_PARMNUM =4;ACCESS_ALL =ACCESS_READ or ACCESS_WRITE or ACCESS_CREATE or ACCESS_EXECor ACCESS_DELETE or ACCESS_ATRIB or ACCESS_PERM;GROUPIDMASK =$8000 ; // MSB set if uid refersGROUP_ALL_PARMNUM =0;GROUP_NAME_PARMNUM =1;GROUP_COMMENT_PARMNUM =2;GROUP_ATTRIBUTES_PARMNUM =3;GROUP_ALL_INFOLEVEL =(PARMNUM_BASE_INFOLEVEL + GROUP_ALL_PARMNUM);GROUP_NAME_INFOLEVEL =(PARMNUM_BASE_INFOLEVEL + GROUP_NAME_PARMNUM);GROUP_COMMENT_INFOLEVEL =(PARMNUM_BASE_INFOLEVEL + GROUP_COMMENT_PARMNUM);GROUP_ATTRIBUTES_INFOLEVEL =(PARMNUM_BASE_INFOLEVEL + GROUP_ATTRIBUTES_PARMNUM);//GROUP_POSIX_ID_PARMNUM未知//GROUP_POSIX_ID_INFOLEVEL =(PARMNUM_BASE_INFOLEVEL + GROUP_POSIX_ID_PARMNUM);NETLOGON_CONTROL_QUERY =1; // No-op: just queryNETLOGON_CONTROL_REPLICATE =2; // Force replicate on BDCNETLOGON_CONTROL_SYNCHRONIZE =3; // Force synchronize on BDCNETLOGON_CONTROL_PDC_REPLICATE =4; // Force PDC to broadcast changeNETLOGON_CONTROL_REDISCOVER =5; // Force to re-discover trusted domain DCsNETLOGON_CONTROL_TC_QUERY =6; // Query status of specified trusted channel statusNETLOGON_CONTROL_TRANSPORT_NOTIFY =7; // Notify netlogon that a new transport has come onlineNETLOGON_CONTROL_FIND_USER =8; // Find named user in a trusted domainNETLOGON_CONTROL_UNLOAD_NETLOGON_DLL =$FFFB;NETLOGON_CONTROL_BACKUP_CHANGE_LOG =$FFFC;NETLOGON_CONTROL_TRUNCATE_LOG =$FFFD;NETLOGON_CONTROL_SET_DBFLAG =$FFFE;NETLOGON_CONTROL_BREAKPOINT =$FFFF;NETLOGON_REPLICATION_NEEDED =$01; // Database is out of dateNETLOGON_REPLICATION_IN_PROGRESS =$02; // Replication is happening nowNETLOGON_FULL_SYNC_REPLICATION =$04; // full sync replication required/progressNETLOGON_REDO_NEEDED =$08; // Redo of previous replication neededTypeLPWSTR=PWideChar;LPVOID=Pointer;LPBYTE=Pointer;//要用到的结构,类型NET_API_STATUS=Cardinal;_USER_INFO_1=Recordusri1_name:LPWSTR;usri1_password:LPWSTR;usri1_password_age
WORD;usri1_priv
WORD;usri1_home_dir:LPWSTR;usri1_comment:LPWSTR;usri1_flags
Word;usri1_script_path:LPWSTR;End;USER_INFO_1=_USER_INFO_1;PUSER_INFO_1=^_USER_INFO_1;LPUSER_INFO_1=^_USER_INFO_1;_USER_INFO_2=Recordusri2_name:LPWSTR;usri2_password:LPWSTR;usri2_password_age
Word;usri2_priv
Word;usri2_home_dir:LPWSTR;usri2_comment:LPWSTR;usri2_flags
Word;usri2_script_path:LPWSTR;usri2_auth_flags
Word;usri2_full_name:LPWSTR;usri2_usr_comment:LPWSTR;usri2_parms:LPWSTR;usri2_workstations:LPWSTR;usri2_last_logon
Word;usri2_last_logoff
Word;usri2_acct_expires
Word;usri2_max_storage
Word;usri2_units_per_week
Word;usri2_logon_hours
BYTE;usri2_bad_pw_count
Word;Dusri2_num_logons
Word;Lusri2_logon_server:LPWSTR;usri2_country_code
Word;usri2_code_page
Word;End;USER_INFO_2=_USER_INFO_2;PUSER_INFO_2=^_USER_INFO_2;LPUSER_INFO_2=^_USER_INFO_2;_USER_INFO_3=Recordusri3_name:LPWSTR;usri3_password:LPWSTR;usri3_password_age
Word;usri3_priv
Word;usri3_home_dir:LPWSTR;usri3_comment:LPWSTR;usri3_flags
Word;usri3_script_path:LPWSTR;usri3_auth_flags
Word;usri3_full_name:LPWSTR;usri3_usr_comment:LPWSTR;usri3_parms:LPWSTR;usri3_workstations:LPWSTR;usri3_last_logon
Word;usri3_last_logoff
Word;usri3_acct_expires
Word;usri3_max_storage
Word;usri3_units_per_week
Word;usri3_logon_hours
BYTE;usri3_bad_pw_count
Word;usri3_num_logons
Word;usri3_logon_server:LPWSTR;usri3_country_code
Word;usri3_code_page
Word;usri3_user_id
Word;usri3_primary_group_id
Word;usri3_profile:LPWSTR;usri3_home_dir_drive:LPWSTR;usri3_password_expired
Word;End;USER_INFO_3=_USER_INFO_3;PUSER_INFO_3=^USER_INFO_3;LPUSER_INFO_3=^USER_INFO_3;_USER_INFO_0=Recordusri0_name:LPWSTR;End;USER_INFO_0=_USER_INFO_0;PUSER_INFO_0=^USER_INFO_0;LPUSER_INFO_0=^USER_INFO_0;_USER_INFO_10=Recordusri10_name:LPWSTR;usri10_comment:LPWSTR;usri10_usr_comment:LPWSTR;usri10_full_name:LPWSTR;End;USER_INFO_10=_USER_INFO_10;PUSER_INFO_10=^_USER_INFO_10;LPUSER_INFO_10=^_USER_INFO_10;_USER_INFO_20=recordusri20_name,usri20_full_name,usri20_comment:LPWSTR;usri20_flags,usri20_user_id
WORD;End;USER_INFO_20=^_USER_INFO_20;PUSER_INFO_20=^_USER_INFO_20;LPUSER_INFO_20=^_USER_INFO_20;_USER_INFO_11=recordusri11_name,usri11_comment,usri11_usr_comment,usri11_full_name:LPWSTR;usri11_priv,usri11_auth_flags,usri11_password_age:dWORD;usri11_home_dir,usri11_parms:LPWSTR;usri11_last_logon,usri11_last_logoff,usri11_bad_pw_count,usri11_num_logons
WORD;usri11_logon_server:LPWSTR;usri11_country_code
WORD;usri11_workstations:LPWSTR;usri11_max_storage,usri11_units_per_week
WORD;usri11_logon_hours
BYTE;usri11_code_page
WORD;END;USER_INFO_11=_USER_INFO_11;PUSER_INFO_11=^_USER_INFO_11;LPUSER_INFO_11=^_USER_INFO_11;_GROUP_USERS_INFO_0=recordgrui0_name:LPWSTR;End;GROUP_USERS_INFO_0=_GROUP_USERS_INFO_0;PGROUP_USERS_INFO_0=^_GROUP_USERS_INFO_0;LPGROUP_USERS_INFO_0=^_GROUP_USERS_INFO_0;_GROUP_USERS_INFO_1=Recordgrui1_name:LPWSTR;grui1_attributes
WORD;end;GROUP_USERS_INFO_1=_GROUP_USERS_INFO_1;PGROUP_USERS_INFO_1=^_GROUP_USERS_INFO_1;LPGROUP_USERS_INFO_1=^_GROUP_USERS_INFO_1;_SHARE_INFO_502=recordshi502_netname:LPWSTR;shi502_type
WORD;shi502_remark:LPWSTR;shi502_permissions
WORD;shi502_max_uses
WORD;shi502_current_uses
WORD;shi502_path:LPWSTR;shi502_passwd:LPWSTR;shi502_reserved
WORD;shi502_security_descriptor
SECURITY_DESCRIPTOR;END;SHARE_INFO_502=_SHARE_INFO_502;PSHARE_INFO_502=^_SHARE_INFO_502;LPSHARE_INFO_502=^_SHARE_INFO_502;_LOCALGROUP_INFO_0 =recordlgrpi0_name:LPWSTR;End;LOCALGROUP_INFO_0=_LOCALGROUP_INFO_0 ;PLOCALGROUP_INFO_0=^_LOCALGROUP_INFO_0 ;LPLOCALGROUP_INFO_0=^_LOCALGROUP_INFO_0 ;_LOCALGROUP_INFO_1=recordlgrpi1_name,lgrpi1_comment:LPWSTR;end;LOCALGROUP_INFO_1=_LOCALGROUP_INFO_1;PLOCALGROUP_INFO_1=^_LOCALGROUP_INFO_1;LPLOCALGROUP_INFO_1=^_LOCALGROUP_INFO_1;_LOCALGROUP_MEMBERS_INFO_0=recordlgrmi0_sid
SID;End;LOCALGROUP_MEMBERS_INFO_0=_LOCALGROUP_MEMBERS_INFO_0;_LOCALGROUP_MEMBERS_INFO_1=recordlgrmi1_sid
SID;lgrmi1_sidusage:SID_NAME_USE;lgrmi1_name:LPWSTR;end;LOCALGROUP_MEMBERS_INFO_1=_LOCALGROUP_MEMBERS_INFO_1;PLOCALGROUP_MEMBERS_INFO_1=^_LOCALGROUP_MEMBERS_INFO_1;LPLOCALGROUP_MEMBERS_INFO_1=^_LOCALGROUP_MEMBERS_INFO_1;_LOCALGROUP_MEMBERS_INFO_2=recordlgrmi2_sid
SID;lgrmi2_sidusage:SID_NAME_USE ;lgrmi2_domainandname:LPWSTR;end;LOCALGROUP_MEMBERS_INFO_2=_LOCALGROUP_MEMBERS_INFO_2;PLOCALGROUP_MEMBERS_INFO_2=^_LOCALGROUP_MEMBERS_INFO_2;LPLOCALGROUP_MEMBERS_INFO_2=^_LOCALGROUP_MEMBERS_INFO_2;_LOCALGROUP_INFO_1002=recordlgrpi1002_comment:LPWSTR;end;LOCALGROUP_INFO_1002=_LOCALGROUP_INFO_1002;PLOCALGROUP_INFO_1002=^_LOCALGROUP_INFO_1002;LPLOCALGROUP_INFO_1002=^_LOCALGROUP_INFO_1002;_LOCALGROUP_MEMBERS_INFO_3=recordlgrmi3_domainandname:LPWSTR;end;LOCALGROUP_MEMBERS_INFO_3=_LOCALGROUP_MEMBERS_INFO_3;//NetApi函数Function NetUserAdd(ServerName
WideChar;Level:Cardinal;Var Buf;var parm_err:Cardinal):NET_API_STATUS; stdcall;Function NetApiBufferFree(Buffer
ointer):NET_API_STATUS; stdcall;Function NetApiBufferAllocate(ByteCount
Word;Var Buffer:LPVOID):NET_API_STATUS; stdcall;Function NetApiBufferReallocate(OldBuffer:LPVoid;NewByteCount
Word;Var NewBuffer:LPVoid):NET_API_STATUS; stdcall;Function NetApiBufferSize(Buffer:LPVOID;Var ByteCount
WORD):NET_API_STATUS; stdcall;Function NetUserChangePassword(domainname,username,oldpassword,newpassword:LPWSTR):NET_API_STATUS; stdcall;Function NetUserDel(servername,username:LPWSTR):NET_API_STATUS; stdcall;Function NetUserEnum(servername:LPWSTR;level,filter
WORD;var bufptr:LPVOID;prefmaxlen
word;var entriesread,totalentries,resume_handle
Word):NET_API_STATUS; stdcall;Function NetUserGetGroups(servername,username:LPWSTR;level
WORD;var bufptr:LPBYTE;prefmaxlen
WORD;var entriesread,totalentries
WORD):NET_API_STATUS; stdcall;Function NetUserGetInfo(servername,username:LPWSTR;level
WORD;var Bufptr:LPBYTE):NET_API_STATUS; stdcall;Function NetShareAdd(servername:LPWSTR;level
WORD;buf:LPBYTE;var parm_err
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupAdd(servername:LPWSTR;level
WORD;buf:LPBYTE;var parm_err
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupAddMembers(servername,LocalGroupName:LPWSTR;level
WORD;buf:LPBYTE; membercount
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupDel(servername,LocalGroupName:LPWSTR):NET_API_STATUS; stdcall;Function NetLocalGroupDelMembers(servername,LocalGroupName:LPWSTR;level
WORD;buf:LPBYTE;membercount
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupEnum(servername:LPWSTR;level
WORD;VAR bufptr:LPBYTE;prefmaxlen
WORD;var entriesread,totalentries,resumehandle
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupGetInfo(servername,LocalGroupName:LPWSTR;Level
WORD;var bufptr:LPBYTE):NET_API_STATUS; stdcall;Function NetLocalGroupGetMembers(servername,localgroupname:LPWSTR;level
WORD;VAR bufptr:LPBYTE;prefmaxlen
WORD;VAR entriesread,totalentries,resumehandle
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupSetInfo(servername,LocalGroupName:LPWSTR;level
WORD;buf:LPBYTE;VAR parm_err
WORD):NET_API_STATUS; stdcall;Function NetLocalGroupSetMembers(servername,LocalGroupName:LPWSTR;level
WORD;buf:LPBYTE;Totalentries
WORD):NET_API_STATUS; stdcall;Function NetShareDel(servername,netname:LPWSTR;reserved
WORD):NET_API_STATUS; stdcall;implementation//函数外部接口function NetUserAdd; external NetApi32DLL name 'NetUserAdd';function NetApiBufferFree; external NetApi32DLL name 'NetApiBufferFree';Function NetApiBufferAllocate; external NetApi32DLL name 'NetApiBufferAllocate';Function NetApiBufferReallocate; external NetApi32DLL name 'NetApiBufferReallocate';Function NetApiBufferSize; external NetApi32DLL name 'NetApiBufferSize';Function NetUserChangePassword; external NetApi32DLL name 'NetUserChangePassword';Function NetUserDel; external NetApi32DLL name 'NetUserDel';Function NetUserEnum; external NetApi32DLL name 'NetUserEnum';Function NetUserGetGroups; external NetApi32DLL name 'NetUserGetGroups';Function NetUserGetInfo; external NetApi32DLL name 'NetUserGetInfo';Function NetShareAdd; external NetApi32DLL name 'NetShareAdd';Function NetLocalGroupAdd; external NetApi32DLL name 'NetLocalGroupAdd';Function NetLocalGroupAddMembers; external NetApi32DLL name 'NetLocalGroupAddMembers';Function NetLocalGroupDel; external NetApi32DLL name 'NetLocalGroupDel';Function NetLocalGroupDelMembers; external NetApi32DLL name 'NetLocalGroupDelMembers';Function NetLocalGroupEnum; external NetApi32DLL name 'NetLocalGroupEnum';Function NetLocalGroupGetInfo; external NetApi32DLL name 'NetLocalGroupGetInfo';Function NetLocalGroupGetMembers; external NetApi32DLL name 'NetLocalGroupGetMembers';Function NetLocalGroupSetInfo; external NetApi32DLL name 'NetLocalGroupSetInfo';Function NetLocalGroupSetMembers; external NetApi32DLL name 'NetLocalGroupSetMembers';Function NetShareDel; external NetApi32DLL name 'NetShareDel';end.