嘿人我有一個劇本,我可以登錄到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