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