2010. március 30., kedd
Get computer name and user
Problem/Question/Abstract:
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.
uses
windows...
var
u: array[0..127] of Char;
c: array[0..127] of Char;
user: string;
computer: string;
sz: dword;
begin
sz := SizeOf(u);
GetUserName(u, sz);
sz := SizeOf(c);
GetComputerName(c, sz);
user := u;
computer := c;
end;
Feliratkozás:
Megjegyzések küldése (Atom)
Nincsenek megjegyzések:
Megjegyzés küldése