命令行方式读取WEB页面
类别: ASP教程
view-webrun.vbs
dim URL, oArgs
2
3 Set oArgs = WScript.Arguments
4
5 if oArgs.Count = 0 then
6 msgbox("错误:必须有URL")
7 wscript.quit 1
8 end if
9
10 URL = oArgs(0)
11
12 on error resume next
13 Set objXML = CreateObject("MSXML2.ServerXMLHTTP")
14
15 if err then
16 msgbox("Error: " & err.description)
17 wscript.quit 1
18 end if
19
20 \' 连接远程机器并取回页面内容
21 objXML.open "GET", URL, False
22
23 objXML.send()
24
25 \' 返回结果
26 msgbox objXML.responSetext
27
28 \' 清场
29 Set objXML = Nothing
dim URL, oArgs
2
3 Set oArgs = WScript.Arguments
4
5 if oArgs.Count = 0 then
6 msgbox("错误:必须有URL")
7 wscript.quit 1
8 end if
9
10 URL = oArgs(0)
11
12 on error resume next
13 Set objXML = CreateObject("MSXML2.ServerXMLHTTP")
14
15 if err then
16 msgbox("Error: " & err.description)
17 wscript.quit 1
18 end if
19
20 \' 连接远程机器并取回页面内容
21 objXML.open "GET", URL, False
22
23 objXML.send()
24
25 \' 返回结果
26 msgbox objXML.responSetext
27
28 \' 清场
29 Set objXML = Nothing
- 上一篇: 怎样才能知道访问者从哪里来
- 下一篇: 操作INI文件的COM
-= 资 源 教 程 =-
文 章 搜 索