Hello Guyz
This is my first post here.
I am having problem in vb.net
I am trying to get a webpage source using this code.

Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(Textbox1.Text)
            Dim response As System.Net.HttpWebResponse = request.GetResponse()

            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())

            Dim sourcecode As String = sr.ReadToEnd()

           Textbox2.Text = sourcecode

Now whenever there is a unicode character in sourcecode it is not showed properly.

But when i manually write that unicode character then it works fine.
Any Idea?
Hoping for quick response.

Edited 5 Years Ago by vb2learn: n/a

Replace line 4 from your posted code with this.

Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream, System.Text.Encoding.Default)

@codeorder
Thanks Mate.
My problem has been resolved.

Thread Marked as Resolved

Edited 5 Years Ago by vb2learn: n/a

This question has already been answered. Start a new discussion instead.