如何使用 winInet.dll 下载网页内容
代码(来自评论):
url="http://links.casemakerlegal.com/states/TX/books/Case_Law/results?search[Cite]=359%20S.W.3d.%20856" Uri urlCheck = new Uri(url);
WebClient wc = new WebClient();
wc.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
Stream data = wc.OpenRead(urlCheck);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();