string url = “http://yyyd.gyzs.net/“;
            WebClient client = new WebClient();
            string v = client.DownloadString(url);
            string[] dates = v.Replace(“<div class=”, “~”).Split(\’~\’);
            string[] date1 = dates[3].Replace(“href=”,”~”).Split(\’~\’);
            string[] date2 = date1[1].Replace(” title=”, “~”).Split(\’~\’);
            string urls= date2[0].Substring(1,39);
            string url1 = “http://yyyd.gyzs.net/” + urls;
            string ss = client.DownloadString(url1);
            System.IO.File.WriteAllText(“E:/gyzs” + 1 + “.html”, ss, Encoding.GetEncoding(“GB2312”));

            命名空间引用 using System.Net;

版权声明:本文为syuhai原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/syuhai/archive/2009/10/26/1589775.html