Private Sub Command1_Click() On Error GoTo err Dim http As Object '建立xmlhttp对象 Set http = CreateObject("MSXML2.XMLHTTP") 'http://arsenal.ek7.cn/cpc.php?task=lynet&id=173 http.Open "GET", "http://www.baidu.com", False http.Send
'判断http状态 If http.readyState = 4 Then Text1.Text = http.Responsetext '成功获取网页源码! Exit Sub End If err: MsgBox err.Number + " " + err.DescriptionEnd Sub
Private Sub Command1_Click()
On Error GoTo err
Dim http As Object '建立xmlhttp对象
Set http = CreateObject("MSXML2.XMLHTTP") 'http://arsenal.ek7.cn/cpc.php?task=lynet&id=173
http.Open "GET", "http://www.baidu.com", False
http.Send
'判断http状态
If http.readyState = 4 Then
Text1.Text = http.Responsetext '成功获取网页源码!
Exit Sub
End If
err:
MsgBox err.Number + " " + err.DescriptionEnd Sub
Get: http://arsenal.ek7.cn/cpa.php?task=lynet&id=173返回:<meta http-equiv="refresh" content="0;URL=cpc.php?task=lynet&id=173&t=1303622695">然后带上Http头refresh: http://arsenal.ek7.cn/cpc.php?task=lynet&id=173&t=1303622733Get:http://arsenal.ek7.cn/cpc.php?task=lynet&id=173&t=1303622530不知道LZ明白了没有待会给你上图吧:
我也通过抓包了
不过感觉这样程序就复杂了
而且我也不太了解VB如何实现这一抓包的功能