了解知识
方法一:
 
If ConnectedToInternet() 
Msgbox, 64, WinInet.dll, ONLINE! 
else 
Msgbox, 48, WinInet.dll, OFFLINE! 
Return 
 
ConnectedToInternet(flag=0x40) { 
Return DllCall("Wininet.dll/InternetGetConnectedState", "Str", flag,"Int",0) 
}
 
 
 
方法二:
 
URL := "http://www.internetwork.net" 
 
If InternetCheckConnection(URL) 
Msgbox, 64, WinInet.dll [%URL%], Connection Success! 
else 
Msgbox, 48, WinInet.dll [%URL%], Connection Failed! 
 
Return 
 
; The Function 
 
InternetCheckConnection(Url="",FIFC=1) { 
Return DllCall("Wininet.dll/InternetCheckConnectionA", Str,Url, Int,FIFC, Int,0) 
}
 
标签: AutoHotkey
扩展知识