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

Is computer attached to a network?

By Zarko Gajic, About.com

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

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

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

Easy ways to connect two computers for networking purposes. 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.