1. Home
  2. Computing & Technology
  3. Delphi Programming

Is computer attached to a network?

By , About.com Guide

Here's a code that will check if a computer is attached to a network

~~~~~~~~~~~~~~~~~~~~~~~~~
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;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to find the size of a folder?
« How to change the background color on different lines of text in a TListBox

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2002 Delphi Tips
  7. Is computer attached to a network?

©2009 About.com, a part of The New York Times Company.

All rights reserved.