用户没有看到浏览器窗口?我想让程序在互联网上 secret 搜索一些东西,并复制第一个网站的文本作为搜索结果。
请您参考如下方法:
您可以使用手气不错的 URL 和 HttpWebRequest:
public Uri GetFirstResult(string term)
{
// Use the I'm Feeling Lucky URL
var url = string.Format("https://www.google.com/search?num=100&site=&source=hp&q={0}&btnI=1", term);
HttpWebRequest req = HttpWebRequest.CreateHttp(url);
return req.GetResponse().ResponseUri;
}
