procedure
TForm1.Button1Click(Sender: TObject); begin
if GetSystemMetrics(SM_NETWORK) AND $01 = $01 then ShowMessage('Machine is attached to network') else ShowMessage('Machine is not attached to network'); end
;