1
我想從此搜索結果中返回HTML,但我能夠得到的是原始頁面的值插入相應的文本框中。這段代碼顯然適用於其他人,我不確定問題是什麼。VB .NET:在HTTP POST後無法獲得正確的響應
' Create a new WebClient instance.
Dim myWebClient As New WebClient()
myWebClient.Headers.Add("user-agent", "Mozilla/5.0 (Windows; Windows NT 5.1; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4")
' Create a new NameValueCollection instance to hold some custom parameters to be posted to the URL.
Dim myNameValueCollection As New NameValueCollection()
' Add necessary parameter/value pairs to the name/value container.
myNameValueCollection.Add("conCSLB", "619412")
' The Upload(String,NameValueCollection)' method implicitly sets the HTTP POST as the request method.
Dim responseArray As Byte() = myWebClient.UploadValues("https://efiling.dir.ca.gov/PWCR/Search", myNameValueCollection)
' Decode and display the response.
Dim response As String = Encoding.UTF8.GetString(responseArray)
你確定你正在調用搜索結果頁嗎?併發送提交按鈕信息? –
我相信是這樣,但這是我提出這個問題的原因之一 - 找出我做錯了什麼。 –