Get username and computername


i have WindowsNT
karen021897Asked:
Who is Participating?
 
intheConnect With a Mentor Commented:
Hi Karen,

procedure TForm1.Button1Click(Sender: TObject);
var
i : cardinal;
user:string;
begin
i:=255;
setlength(user,i);
getusername(pchar(user),i);
setlength(user,(i-1));
showmessage(user);

end;


just change getusername to GetComputerName for the computer name.

Regards Barry
0
 
karen021897Author Commented:
Thanks for quick answer , i raise the points up to 150.

Karen
0
 
karen021897Author Commented:
Thanks for quick answer , i raise the points up to 150.

Karen
0
 
intheCommented:
thankyou & Merry XMas:-)
0
All Courses

From novice to tech pro — start learning today.