
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
CODE: [Copy to clipboard]'大概一个例子,webstring里边的文本就是当前URL的源文件,你可以FSO,ADS保存
webstring = getweb("http://www.sohu.com")
function getweb(url)
dim xmlhttp
set xmlhttp = createobject("msxml2.xmlhttp")
xmlhttp.open "POST",url,false
xmlhttp.send(now)
getweb = xmlhttp.responsetext
end function
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
CODE: [Copy to clipboard]Const URI = "http://www.sohu.com"
Call SaveFile(URI,"temp.txt")
Function GetHtml(url)
Set xml = CreateObject("MsXml2.XMLHTTP")
xml.open "GET",url,False '优先读IE缓存使用GET,否则使用POST
xml.send
GetHtml =xml.ResponseBody
Set xml = Nothing
End Function
Sub SaveFile(url,file)
Set oStream = CreateObject("ADODB.Stream")
With oStream
.Type = 1
.Open
.Write GetHtml(url)
.SaveToFile file
.Flush
.Close
End With
Set oStream = Nothing
End Sub
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |