IP
用于设置或检索 IP 地址或主机名。
语法
HTTPObject.IP
其中:
IP
是字符串(读/写)
示例
该脚本将重复使用同一个对象连接不同的主机并发送同一个请求:
函数 Main
Dim HTTPObj As Object
ip1 = "www.gfi.com"
ip2 = "127.0.0.1"
port = 80
cr = Chr(13) + Chr(10)
Set HTTPobj = HTTP.Connect (ip1,port)
'设置请求类型
HTTPobj.GetURL("/")
'使用自动身份验证通过代理
'身份验证必须设置为 1
HTTPobj.Authentication = 1
'发送 GET 请求
HTTPResponse1 = HTTPobj.SendRequest ()
HTTPobj.IP = ip2
HTTPResponse2 = HTTPobj.SendRequest ()
echo "Result: " + CStr(HTTPResponse1)+cr
echo "Result: " + CStr(HTTPResponse2)+cr
End 函数