Author: Den Bedard
This article presents a code snipet which shows how to get the current user and the
computer name.
Answer:
Obviously this is not a complete program, but you can use the Windows API calls
GetUserName and GetComputerName as shown below.
1 uses2 windows...
3 4 var5 u: array[0..127] of Char;
6 c: array[0..127] of Char;
7 user: string;
8 computer: string;
9 sz: dword;
10 begin11 sz := SizeOf(u);
12 GetUserName(u, sz);
13 14 sz := SizeOf(c);
15 GetComputerName(c, sz);
16 17 user := u;
18 computer := c;
19 end;