Dim xmlHttp As Object
Private Function aaa(url As String)
Set xmlHttp = CreateObject("Microsoft.XMLHTTP")
xmlHttp.Open "GET",url,True
xmlHttp.send (Null)
While xmlHttp.ReadyState <> 4
DoEvents
Wend
aaa = xmlHttp.responseText
End Function
Sub sheep()
MsgBox aaa("http://www.baidu.com")
End Sub
'==============================一下是POST数据实例====================
Sub test2()Dim xmlhttpSet xmlhttp = CreateObject("msxml2.xmlhttp")With xmlhttp.Open "POST","http://127.0.0.1:8012/json.PHP?mode=9",False.setRequestHeader "Content-Type","application/x-www-form-urlencoded".send "mode=9"MsgBox .responseText '显示POST之后网页返回的结果End WithSet xmlhttp = NothingEnd Sub