Connected To Internet() 的替代方法,它不起作用

Alternative for Connected To Internet(), it doesn‘t work

这个命令只是无效的,它不起作用。

代码:

Internet = disconnected


Internet:
If Connected To Internet()
{
Internet = connected
}
else {
Sound beep 1000,250
Internet = disconnected
}
return

<^<!=::Msg Box internet:%internet%

我可以使用什么来代替 Connected to internet() 函数?

有答案吗?谢谢。

此外,我使用的是当前版本的自动热键

尝试

<^<!=::
    If DllCall("Wininet.dll\InternetGetConnectedState", "Str", 0x40,"Int",0) 
        MsgBox, 262208, Info, Internet = connected
    else
    {
        SoundBeep 1000,250
        MsgBox,4144, Warning, Internet = disconnected
    }
return