Get Computer Name - Delphi


Hello guys.. still with me now.. comeback again with experient to finding code, as you can..

maybe you need computer name this is simple function to get it.

Just simple : add fuction

function ComputerName : String;
var
buffer: array[0..255] of char;
size: dword;
begin //yutant.blogspot.com
size := 256;
if GetComputerName(buffer, size) then
Result := buffer
else
Result := ''
end;

and call it (^_^)

 procedure Tfrm.ButtonClick(Sender: TObject);
begin
label1.Caption := ComputerName;
end;