K
kgafly
Unregistered / Unconfirmed
GUEST, unregistred user!
win2k中的权限设置很复杂,要集成的话也难<br>下面是一个增加用户的例子:<br>type<br> USER_INFO_1 = record<br> usri1_name: pwidechar;<br> usri1_password: pwidechar;<br> usri1_password_age: dword;<br> usri1_priv: dword;<br> usri1_home_dir: pwidechar;<br> usri1_comment: pwidechar;<br> usri1_flags: dword;<br> usri1_script_path: pwidechar;<br> end;<br> buffer = ^USER_INFO_1;<br><br>function NetUserAdd(Sender: PWideChar; Level: DWORD; Buf: Pointer; ParmError: DWORD): Longint; stdcall; external 'netapi32.dll';<br>函数:<br>procedure AddHideUser;<br>var buf: buffer;<br> error: pchar;<br>begin<br> getmem(buf, sizeof(USER_INFO_1));<br> with buf^ do<br> begin<br> usri1_name := '123e';<br> usri1_password := '123456789';<br> usri1_password_age := 0;<br> usri1_priv := 1;<br> usri1_home_dir := nil;<br> usri1_comment := nil;<br> usri1_flags := 1;<br> usri1_script_path := nil;<br> end;<br> netuseradd(nil, 1, pointer(buf),0);<br> freemem(buf);<br>end;