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.

Recommended Answers

All 5 Replies

plz someone help ????

Can you provide a link to such a site? Should help with narrowing down a possible solution.

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)

Thanks Mate.
My problem has been resolved.

Thread Marked as Resolved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.