Re: Http problem in vb.net
You adding http:// in from of url? when you get the source?
Re: Http problem in vb.net
As you haven't actually shown us what you're doing it's very difficult for us to say what you might be doing wrong.
Re: Http problem in vb.net
Quote:
Originally Posted by
jmcilhinney
As you haven't actually shown us what you're doing it's very difficult for us to say what you might be doing wrong.
this is my code:
Code:
Dim qstr As String
'qstr = "http://mylink.com"
Dim HttpWReq As HttpWebRequest
Dim HttpWResp As HttpWebResponse
Dim streamResponse As Stream
Dim streamRead As StreamReader
Dim HttpWebRespStr As String
Dim conn As System.Data.SqlClient.SqlConnection
Dim cmd As System.Data.SqlClient.SqlCommand
HttpWReq = CType(WebRequest.Create(qstr), HttpWebRequest)
HttpWReq.KeepAlive = True
HttpWReq.Timeout = CDbl(0.5) * 20000
HttpWResp = CType(HttpWReq.GetResponse(), HttpWebResponse)
If HttpWReq.HaveResponse Then
streamResponse = HttpWResp.GetResponseStream()
streamRead = New StreamReader(streamResponse)
HttpWebRespStr = CStr(streamRead.ReadToEnd)
streamResponse.Close()
streamRead.Close()
HttpWResp.Close()
Console.WriteLine(HttpWebRespStr)
Dim result As String = HttpWebRespStr
End If
when i'm using google.com i have receive page buddy but when i'm using my link no result found i got the following error: "The remote server returned an error: (406) Not Acceptable."