Get Computer Name

posted 18 Sep 2010, 14:41 by Delphi Basics
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;
Comments