日期:2011-02-20  浏览次数:20539 次

using System;
using System.Net;
using System.Text;
using System.IO;
class Test {
[STAThread]
public static void Main(string[] args) {
Uri uri = new Uri("http://www.apache.org");
WebRequest wr = WebRequest.Create(uri);
Stream s = wr.GetResponse().GetResponseStream();
StreamReader sr = new StreamReader(s, Encoding.Default);
Console.WriteLine(sr.ReadToEnd());
sr.Close();
s.Close();
Console.ReadLine();
}
}