Jesper,
Take a look at the documentation of the WebClient class, it contains this
code in the DownloadData(string) method
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);
Console.WriteLine("Download successful.");
You need to add a using statement for System.Net for this.
- Mark
On Thu, 02 Mar 2006 15:39:15 +0800, Jesper
<Je****@discussions.microsoft.com> wrote:
Hi,
I would like to read the html into a string from a certain URL. How is
this
done?
Best regards Jesper.