Façon simple et sûre (qui marche à tous les coups) pour savoir si

kidpigeyre Messages postés 96 Date d'inscription mardi 3 juillet 2001 Statut Membre Dernière intervention 2 novembre 2006 - 8 août 2002 à 13:43
pHoEnIxFuRy Messages postés 67 Date d'inscription mercredi 17 juillet 2002 Statut Membre Dernière intervention 18 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:

1 réponse

pHoEnIxFuRy Messages postés 67 Date d'inscription mercredi 17 juillet 2002 Statut Membre Dernière intervention 18 juillet 2006 1
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
0
Rejoignez-nous