sambalec Posted February 7, 2010 Posted February 7, 2010 Hi ! How to detect with a autoit command if internet is connected or not connected ? Thank's a lot
Zibit Posted February 7, 2010 Posted February 7, 2010 take this might do you some good... while 1 $nSize = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat") sleep(5000) if $nSize = 0 then ToolTip("No Connection", 0, 0) if $nSize <> 0 then ToolTip("Connection Established", 0, 0) wend Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam
Shark007 Posted February 7, 2010 Posted February 7, 2010 (edited) another way... $ping = Ping("google.com", 500) If $ping > 0 Then MsgBox(0, "", CONNECTED) EndIf Edited February 7, 2010 by Shark007
PartyPooper Posted February 8, 2010 Posted February 8, 2010 (edited) This is what I'd use: #include <INet.au3> Global sPublicIP HttpSetProxy(0) ; ; get WAN IP of user Do $sPublicIP = GetWANIP() ; get WAN IP Until $sPublicIP <> -1 ; Func GetWANIP() $sPublicIP = _GetIP() ; check WAN IP If @error Then Local $iBtnID = MsgBox("262197","ERROR","CAN'T GET WAN IP" & @CRLF & "Possible cause: Blocked by Firewall, Sandbox or insufficient bandwidth.") If $iBtnID = 2 Then Exit ; Cancel pressed If $iBtnID = 4 Then Return ($sPublicIP) ; Retry pressed (goes back to calling loop and returns again) EndIf Return ($sPublicIP) EndFunc ;==>GetWANIP Edit: forgot to add the include. Edited February 8, 2010 by PartyPooper
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now