Façon simple et sûre (qui marche à tous les coups) pour savoir si
kidpigeyre
Messages postés96Date d'inscriptionmardi 3 juillet 2001StatutMembreDernière intervention 2 novembre 2006
-
8 août 2002 à 13:43
pHoEnIxFuRy
Messages postés67Date d'inscriptionmercredi 17 juillet 2002StatutMembreDernière intervention18 juillet 2006
-
20 août 2002 à 11:54
je cherche une façon simple et sûre (qui marche à tous les coups) pour savoir si on est connecté.
Si on l'est ds ce cas la variable reponse se met à 1 sinon elle reste à zéro.
mci.
A voir également:
Façon simple et sûre (qui marche à tous les coups) pour savoir si
pHoEnIxFuRy
Messages postés67Date d'inscriptionmercredi 17 juillet 2002StatutMembreDernière intervention18 juillet 20061 20 août 2002 à 11:54
Un bouton de commande ki lance le test et une textbox ki te dis si tu est connecté ( résultat booleen ).
Le prog vérifie si tu pe accéder à microsof.com ou autre.
L'avantage C ke par routeur ou modem ca marche !!!
Voila G po trouvé plus court.
Private Const FLAG_ICC_FORCE_CONNECTION = &H1
Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Public Function INetCheckConnect2(Optional strWebSiteOrIP As String) As Boolean
If (LenB(strWebSiteOrIP) = 0) Then
strWebSiteOrIP = "http://www.microsoft.com/"
'Else
End If
If InternetCheckConnection(strWebSiteOrIP, FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then
INetCheckConnect2 = False
Else
INetCheckConnect2 = True
End If
End Function
Private Sub Command1_Click()
Text1 = INetCheckConnect2
End Sub