Very recently, some of the pages return a [] character while others return the full source code of the page. When I go to the pages outside of my programming, the source code can be seen just as they should.
Why would this be happening and is there a way around this?
I woudl try to download the data with WebClient.DownloadData() method and than labore with Encoding.(...).GetString() to get the source code of the page as string.
From MSDN:
Code:
Console.Write("\nPlease enter a URI (for example, http://www.contoso.com): ");
string remoteUri = Console.ReadLine();
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
// Download home page data.
Console.WriteLine("Downloading " + remoteUri);
// Download the Web resource and save it into a data buffer.
byte[] myDataBuffer = myWebClient.DownloadData (remoteUri);
// Display the downloaded data.
string download = Encoding.ASCII.GetString(myDataBuffer);
Console.WriteLine(download);
Bookmarks