百度收录数 代码

来源:百度知道 编辑:UC知道 时间:2024/05/10 13:53:37
我想写个简单的,查询百度收录的代码。

也就是site:www.chenyu52.cn

这个,就可以查www.chenyu52.cn在百度的收录数了,但是我在C#当中,怎么

获取这个数字呢??

string uri = "http://www.baidu.com/s?wd=site:chenyu52.cn";
string html = new WebClient().DownLoadString(uri);
string number = new Regex("找到相关网页约([\d,]+)篇").Match.Groups[1].Value;

C#中有一个工具,是获取网页中的元素,然后你获取你想要的不就行了 ̄