Function DownLoadHtm(Url) As String
On Error Resume Next
DownLoadHtm = True
Dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", Url, False, "", ""
.setRequestHeader "If-Modified-Since", "0"
.setRequestHeader "Cache-Control", "no-cache"
.setRequestHeader "Connection", "close"
.Send
If .Readystate <> 4 Then
DownLoadHtm = False
Exit Function
End If
DownLoadHtm = StrConv(.ResponseBody, vbUnicode)
End With
Set Retrieval = Nothing
End Function
举例:
dim s as string
s=DownLoadHtm("http://zhidao.baidu.com/question/174898113.html#here")
思路的话用Socket多线程咯,代码没有