Exemple : "Tester ma connexion Internet en Boucle"
:salut: Voila un petit exemple Tester ma connexion Internet en Boucle
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| '-------------TEST DE CONNEXION INTERNET ET SMTP DE GMAIL-----------
Boucle = True
While Boucle = True
strComputer = "smtp.gmail.com"
MsgTitre = "TEST DE CONNEXION INTERNET ET SMTP DE GMAIL © Hackoo © 2011"
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}!\\").ExecQuery("select * from Win32_PingStatus where address = '" & strComputer & "'")
For Each objStatus in objPing
If objStatus.Statuscode = 0 Then
msgbox "TEST SMTP DE GMAIL EST OK . VOUS ETES CONNECTE A INTERNET ET LE SMTP DE GMAIL EST DISPONIBLE ! " & objStatus.Statuscode,64,MsgTitre
Boucle = False
'Explorer("http://192.168.1.1")
wscript.quit
else
msgbox "TEST SMTP DE GMAIL EST NO OK . VOUS N'ETES PAS CONNECTE A INTERNET ET LE SMTP DE GMAIL N'EST PLUS DISPONIBLE EN CE MOMENT !" & objStatus.Statuscode,16,MsgTitre
Explorer("http://192.168.1.1") 'pour entrer dans la page du routeur et régler la configuration Internet par un reboot à distance du routeur
End If
Next
wscript.sleep 60000
Wend
Function Explorer(File)
set ws = CreateObject("wscript.shell")
ws.Run "explorer " & File
end Function |