IP

用於設定或擷取 IP 位址或主機名稱。

語法

HTTPObject.IP

其中:

  • IP 是字串(讀/寫)
範例

該指令碼將重複使用同一個物件連線到不同的主機並傳送同一個要求:

Function 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("/")

'經由自動驗證通過 Proxy

'驗證必須設為 1

HTTPobj.Authentication = 1

'傳送 GET 要求

HTTPResponse1 = HTTPobj.SendRequest ()

HTTPobj.IP = ip2

HTTPResponse2 = HTTPobj.SendRequest ()

echo "結果: " + CStr(HTTPResponse1)+cr

echo "結果: " + CStr(HTTPResponse2)+cr

End Function