嘿人我有一个剧本,我可以登录到Facebook上分享这个工作得很好,但现在我尝试在其他网站登录我得到的500错误在互联网上找到。(500)内部服务器错误在网站登录脚本
Dim cookieJar As New Net.CookieContainer()
Dim request As Net.HttpWebRequest
Dim response As Net.HttpWebResponse
Dim strURL As String = "http://xtract.basdistributie.nl:4040/Account/LogOn"
Try
request = Net.HttpWebRequest.Create(strURL)
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
request.Method = "GET"
request.CookieContainer = cookieJar
response = request.GetResponse()
For Each tempCookie As Net.Cookie In response.Cookies
cookieJar.Add(tempCookie)
Next
'Send the post data now
request = Net.HttpWebRequest.Create(strURL)
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
request.Method = "POST"
request.AllowAutoRedirect = True
request.CookieContainer = cookieJar
Dim writer As StreamWriter = New StreamWriter(request.GetRequestStream())
writer.Write("username=???????&password=????????")
writer.Close()
response = request.GetResponse()
'Get the data from the page
Dim stream As StreamReader = New StreamReader(response.GetResponseStream())
Dim data As String = stream.ReadToEnd()
response.Close()
If data.Contains("BAS Distribution Xtract") = True Then
MsgBox("ingelogd")
End If
MsgBox(data)
Catch e As Exception
If TypeOf e Is WebException AndAlso DirectCast(e, WebException).Status = WebExceptionStatus.ProtocolError Then
Dim errResp As WebResponse = DirectCast(e, WebException).Response
' read the error response
Using respStream As Stream = errResp.GetResponseStream()
MsgBox(e.ToString)
End Using
End If
End Try
错误信息上找到应对地方= request.GetResponse()我也有菲德勒试图获得更好的错误消息,但从来没有与this.I工作也了解在互联网上的东西,错误是因为该网站是建立在asp而不是.net这是真的吗?
所有帮助表示赞赏
该网页的参数是好的,我现在已经加倍检查。我现在要去尝试其他4个步骤的Tanx快速反应。 – AntoonVs
好吧,我已经第一次尝试用WireShark来检索你问的数据,但这对我没有用。所以我发现一些数据与Fidler2希望这是你需要帮助 – AntoonVs
我试着给出正确的信息,但我不知道如何能有人请求帮助 – AntoonVs