I want to get HTML code to be displayed in a RichTextBox. I am using the code
WebClient client = new WebClient();
byte[] data = client.DownloadData("http://www.google.com");
richTextBox1.Text = data.ToString();
How can I do this?
Also: I don’t know why but this shows me “System.Byte[]” on the RichTextBox.
It shows
System.Byte[]Because it is show the description ofdata, notdata‘s contents. to do this do something like:To see the actual content
EDIT
Or you can do
WebClient.DownloadStringlike @Ria Suggested. Only I would implement it like this:Or to be more efficient even