110,539
社区成员
发帖
与我相关
我的任务
分享
string html = Encoding.GetEncoding("GBK").GetString(new System.Net.WebClient().DownloadData("http://www.100to.com/item.htm?id=4608977035"));
Match m = System.Text.RegularExpressions.Regex.Match(html, @"(?is)<title>(.+)</title.+?<div class=""gallery"">.+?<img.+?src=""([^""]+)");
string title = m.Groups[1].Value;//标题
string imgUrl = m.Groups[2].Value;//图片地址
string html = Encoding.GetEncoding("GBK").GetString(new System.Net.WebClient().DownloadData("http://www.100to.com/item.htm?id=4608977035"));
string title = System.Text.RegularExpressions.Regex.Match(html, "(?is)(?<=<title[^>]*>)((?!</title).)+").Value;
//title就是你要的结果。