本文共 751 字,大约阅读时间需要 2 分钟。
/****************************************************************************************************** * 查看baidu首页html源码的cs代码,ASP.NET入门中。。。******************************************************************************************************/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.IO;namespace WebRequestorApp{ class Program { static void Main(string[] args) { WebRequest req = WebRequest.Create("http://www.baidu.com"); WebResponse resp = req.GetResponse(); StreamReader reader = new StreamReader(resp.GetResponseStream(), Encoding.ASCII); Console.WriteLine(reader.ReadToEnd()); return; } }}
转载地址:http://enbqb.baihongyu.com/