ailuzhen 发表于 2013-1-24 23:16:47

判断本机网络状态是否离在线,两个返回值都是1,大大们给我个修正版好吗?

Global Const $NETWORK_ALIVE_LAN = 0x1
Global Const $NETWORK_ALIVE_WAN = 0x2


$x =DLLCall("sensapi.dll","int","IsNetworkAlive","str",$NETWORK_ALIVE_LAN)
msgbox (4096,"测试",$x)


如题!

netegg 发表于 2013-1-25 01:32:57

DLLCall("sensapi.dll","int","IsNetworkAlive","int",$NETWORK_ALIVE_LAN)

annybaby 发表于 2013-1-25 02:14:03

回复 1# ailuzhen

$x =DLLCall("sensapi.dll","int","IsNetworkAlive","int*",0)
msgbox (4096,"测试",$x)

haijie1223 发表于 2013-1-25 08:07:47

最好再加上个ping("www.baidu.com"),刚才试了一下,路由器连接上,但是不拨号的情况下,依然返回1。

haijie1223 发表于 2013-1-25 08:28:45

看了下msdn的好像应该这么写的:#include <array.au3>
Global Const $NETWORK_ALIVE_LAN = 0x1
Global Const $NETWORK_ALIVE_WAN = 0x2
$net = DllCall("sensapi.dll", "bool", "IsNetworkAlive", "DWORD*", $NETWORK_ALIVE_LAN)
_ArrayDisplay($net)
页: [1]
查看完整版本: 判断本机网络状态是否离在线,两个返回值都是1,大大们给我个修正版好吗?