Determining if connected to network

 if GetSystemMetrics(SM_NETWORK) and 1 <> 0 then
   DoSomethingWithNetwork
 else
  DoSomethingWithoutNetwork: