-
March 1st, 2015, 07:24 PM
#1
[RESOLVED] HttpRequest generating weird strings ' and "...
This is my code these strings dont show up when I use Webrowser control btw. I think it has to be with the encoding so I explicitly assigned UTF8 to the streamreader with no success any idea about how to fix this pls?
Code:
Sub HttpRequest(url As String)
Try
Dim myRequest As System.Net.HttpWebRequest = WebRequest.Create(url)
myRequest.Credentials = CredentialCache.DefaultCredentials
'// Get the response
Dim webResponse As WebResponse = myRequest.GetResponse
Dim respStream As Stream = webResponse.GetResponseStream
'//
Dim ioStream As StreamReader = New StreamReader(respStream, Encoding.UTF8)
Dim pageContent As String = ioStream.ReadToEnd
MsgBox(pageContent)
Catch ex As Exception
Label1.Text = ex.Message
End Try
End Sub
End Class
Thx in advance!!
-
March 2nd, 2015, 06:07 AM
#2
Re: HttpRequest generating weird strings ' and "...
Victor Nijegorodov
-
March 2nd, 2015, 01:47 PM
#3
Re: HttpRequest generating weird strings ' and "...
Thx victor i solved it yesterday, ill post the answer for the sake of future visitors and i hoppe it helps anyone else.
System.Net.WebUtility.HtmlDecode
Code:
Descripcion = System.Net.WebUtility.HtmlDecode(Descripcion)
Thx for your time
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|