You first need to Create 2 Variables
NameSize : DWORD;
ComputerName : PChar;
Then use this code to read the name and place it in a label
ComputerName := #0;
NameSize := MAX_COMPUTERNAME_LENGTH + 1;
try
GetMem(ComputerName, NameSize);
Windows.GetComputerName(ComputerName, NameSize);
Label1.Caption:= StrPas(ComputerName);
finally
FreeMem(ComputerName);
end;
You could create another Variable (String this time) and then assign the value to that instead of the Label Caption.
Kind Regards, Paul Benn
**** Never Giveup, keep trying, the answer is out there!!! ****