找回密码
 加入
搜索
查看: 2458|回复: 4

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

[复制链接]
发表于 2013-1-24 23:16:47 | 显示全部楼层 |阅读模式
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[0])


如题!
发表于 2013-1-25 01:32:57 | 显示全部楼层
DLLCall("sensapi.dll","int","IsNetworkAlive","int",$NETWORK_ALIVE_LAN)
发表于 2013-1-25 02:14:03 | 显示全部楼层
回复 1# ailuzhen

$x =DLLCall("sensapi.dll","int","IsNetworkAlive","int*",0)
msgbox (4096,"测试",$x[0])
发表于 2013-1-25 08:07:47 | 显示全部楼层
最好再加上个ping("www.baidu.com"),刚才试了一下,路由器连接上,但是不拨号的情况下,依然返回1。
发表于 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)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-26 00:46 , Processed in 0.098281 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表