Get Computer Name

Post date: Sep 18, 2010 9:41:29 PM

Returns the Computer Name

function ComputerName():String;
var
  ComputerName: Array [0 .. 256] of char;
  Size: DWORD;
begin
  Size := 256;
  GetComputerName(ComputerName, Size);
  Result := ComputerName;
end;