ping [v2.0]

作者: Drugwash 最近更新时间: 20100429


Sends a test ping signal to a host through the ip protocol. It checks if the destination is reachable.

ping(addr, data="AHK ping test", timeout="500")
ping_(adr, data, timeout)
ping_DW2IP(adr)
ping_GetError(code, func="[ukn]")
ping_Host2IP(name)

关于函数的参数和返回值, 请参阅其源码.

备注

Not sure if usage at demo file is correct.

The author wrote about the license:

"This script is of course free to change and republish for everyone, as per the AHK license."

"License, as mentioned before, is same as AutoHotkey's."
At this time of writing, it is GPL v2. Answer: http://www.autohotkey.com/forum/viewtopic.php?p=342625#342625

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?t=44677

许可

此函数(集)是基于 GNU GPL 许可的开源项目. 想了解许可详情, 请参见 gpl-2.0.txt

示例

; #Include ping.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

hostlist := "127.0.0.1|192.168.2.1|http://www.google.com||http://www.wikipedia.com|99.99.99.99|"
data := "AHK test"
timeout := "500"

Loop, Parse, hostlist, |
{
    MsgBox,, %A_LoopField%, % ping(A_LoopField, data, timeout)
}