【发布时间】:2014-03-04 13:45:34
【问题描述】:
我有以下脚本,但没有成功执行它而没有错误。我想将一个变量放入一个 URL 并 ping 该 URL。
#include <Excel.au3>
$sFilePath1 = "D:\Desktop\1.xlsx"
$oExcel = _ExcelBookOpen($sFilePath1, 0)
For $i = 1 To 2 ; Loop
Local $username = _ExcelReadcell($oExcel, $i, 1) ;Reading created Excel
Local $iPing = Ping("http://blogsearch.google.co.in/ping?url="$username"&btnG=Submit+Blog&hl=en", 2500)
If $iPing Then ; If a value greater than 0 was returned then display the following message.
MsgBox(0, "STATUS", "Ping Successful", 1)
Else
MsgBox(0, "STATUS", "ERROR", 1)
EndIf
Next
【问题讨论】:
-
您好,欢迎来到 SO。请添加更多详细信息,例如您遇到的错误和所需的输出。
-
它必须从 excel 获取 url 并 ping 整个 url,而不是 "$username"。
-
本地 $iPing = Ping("blogsearch.google.co.in/…", 2500) 本地 $iPing = Ping("blogsearch.google.co.in/…", 2500)
-
你想达到什么目的? Ping 返回 域 的往返时间。 Url 指令(您的变量)与
Ping()无关;它只是将您的 ping 返回到blogsearch.google.co.in。 HTTP 和 ICMP 是不同的概念。 Related.
标签: string variables ping autoit