My.Computer.Network.IsAvailable will do that for you all by itself