size : 531 uploaded_on : Thu Oct 8 00:00:00 1998 modified_on : Wed Dec 8 14:03:13 1999 title : User- and computername org_filename : Username.txt author : Ulli Conrad authoremail : uconrad@gmx.net description : How to get current username and computer name keywords : tested : D3 submitted_by : The CKB Crew submitted_by_email : ckb@netalive.org uploaded_by : nobody modified_by : nobody owner : nobody lang : plain file-type : text/plain category : delphi-system32bit __END_OF_HEADER__ { How to get current username and computer name By U. Conrad <uconrad@gmx.net> } procedure Username; var Username : pChar; nSize : integer; begin Username:=StrAlloc(30); { Username length is limited under Windows } nSize:=30; GetUserName(Username,nSize); { Retrieves the username } { Do any operation with username } StrDispose(Username); { Free string } { It's the same for the computer name. Simply replace GetUsername() by GetComputerName(), parameters are the same } end;