首页 > 代码库 > c#获取网页html

c#获取网页html

        static void Main(string[] args)        {            WebRequest wrq =   WebRequest.Create("http://www.baidu.com");            WebResponse wrs = wrq.GetResponse();            Stream strm = wrs.GetResponseStream();            StreamReader sr = new StreamReader(strm);            string line;            while ((line = sr.ReadLine()) != null)            {                Console.WriteLine(line);            }            Console.Read();            strm.Close();        }

 

c#获取网页html