procedure TForm1.Button1Click(Sender: Tobject);<br>var<br> ComputerName: array[0..MAX_COMPUTERNAME_LENGTH+1] of char; // holds the name<br> Size: DWORD; // holds the size<br>begin<br> {initialize the computer name size variable}<br> Size := MAX_COMPUTERNAME_LENGTH+1;<br><br> {retrieve the computer name}<br> if GetComputerName(ComputerName, Size) then<br><br> Edit1.Text := StrPas(Computername)<br> else Showmessage('Computer Name Not Found');<br>end<br><br>