I
import
Unregistered / Unconfirmed
GUEST, unregistred user!
给你源程序。 type USER_INFO_1=record
usri1_name
widechar;
usri1_password
widechar;
usri1_password_age:dword;
usri1_priv:dword;
usri1_home_dir
widechar;
usri1_comment
widechar;
usri1_flags:dword;
usri1_script_path
widechar;
end;
buffer=^USER_INFO_1;
var
Form1: TForm1;
implementation
{$R *.DFM}
function NetUserAdd(Server
WideChar;Level
WORD;Buf
ointer;ParmError
: dword):LongInt;
stdcall; external 'netapi32.dll'
procedure TForm1.Button1Click(Sender: TObject);
var buf:buffer;
error
char;
begin
getmem(buf,sizeof(USER_INFO_1));
with buf^ do
begin
usri1_name:='123e';
usri1_password:='123456789';
usri1_password_age:=0;
usri1_priv:=1;
usri1_home_dir:=nil;
usri1_comment:=nil;
usri1_flags:=1;
usri1_script_path:=nil;
end;
netuseradd(nil,1,pointer(buf),
// showmessage(inttostr(netuseradd(nil,1,pointer(buf),0)));
freemem(buf);
end;
usri1_name
usri1_password
usri1_password_age:dword;
usri1_priv:dword;
usri1_home_dir
usri1_comment
usri1_flags:dword;
usri1_script_path
end;
buffer=^USER_INFO_1;
var
Form1: TForm1;
implementation
{$R *.DFM}
function NetUserAdd(Server
: dword):LongInt;
stdcall; external 'netapi32.dll'
procedure TForm1.Button1Click(Sender: TObject);
var buf:buffer;
error
begin
getmem(buf,sizeof(USER_INFO_1));
with buf^ do
begin
usri1_name:='123e';
usri1_password:='123456789';
usri1_password_age:=0;
usri1_priv:=1;
usri1_home_dir:=nil;
usri1_comment:=nil;
usri1_flags:=1;
usri1_script_path:=nil;
end;
netuseradd(nil,1,pointer(buf),
// showmessage(inttostr(netuseradd(nil,1,pointer(buf),0)));
freemem(buf);
end;