Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
想做自动登录这个网站的,但是处处碰壁,他们都需要Cookies来保持通讯,我这样写也抓不到COOK 我搜了整个百度,全部都是C#的源码... VB对于这些还真的没多大看头。。。
求解决
VB
VB.NET
POST
--------------------编程问答--------------------
哇,还有奖励?
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Huoqu As HttpWebRequest
Huoqu = CType(WebRequest.Create(New Uri("http://qibao.gyyx.cn")), HttpWebRequest)
Huoqu.Method = "GET"
Huoqu.Headers.Set(HttpRequestHeader.Cookie, "Set-Cookie")
Dim res As HttpWebResponse = CType(Huoqu.GetResponse(), HttpWebResponse)
MsgBox(res.Cookies.ToString)
WebBrowser2.Navigate("http://qibao.gyyx.cn")
End Sub