Advertisement
4_2005-2006 Internet/ HTML #154498

Determine if Connected to Internet (even through network)

Simple way to tell if a user is connected to the internet

AI

Resumo por IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Código fonte
original-source
Public Sub CheckIfConnected()
 Winsock1.Close
 Winsock1.Connect "www.yahoo.com", 80
 
 While Winsock1.state <> sckConnected
  If Winsock1.state = sckError Then GoTo Offline
  DoEvents
 Wend
 
 MsgBox "Online"
 Winsock1.Close
 Exit Sub
Offline:
 MsgBox "Offline"
End Sub
Comentários originais (3)
Recuperado do Wayback Machine