know if a computer is attached to a network?

Author: Thomas Stutz 

Homepage: http://www.swissdelphicenter.ch

2 Comments to this tip [Write new comment]

[ Print tip ]    

 

Tip Rating (23):  

Skill:  

Useful:  

Overall:  

 

 

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  if GetSystemMetrics(SM_NETWORK) and $01 = $01 then

    ShowMessage('Computer is attached to a network!')

  else

    ShowMessage('Computer is not attached to a network!');

end;