using System;
using System.Net;
using System.IO;
public class MainClass {
[STAThread]
public static void Main(string[] args)
{
string htmlUri = "http://www.java2java.com";
WebRequest requestHtml = WebRequest.Create(htmlUri);
WebResponse responseHtml = requestHtml.GetResponse();
// Read the text from the response stream.
using (StreamReader r = new StreamReader(responseHtml.GetResponseStream()))
{
Console.WriteLine( r.ReadToEnd());
}
}
}
|