提取<td></td>中的内容(把<td>和</td>都转程ascii码)StreamReader sr = new StreamReader("xxx.htm", Encoding.GetEncoding("gb2312")); string MatchingScript = rs.ReadLine(); RegStr="\x3c\x74\x64\x3e(.*|\n)\x3c\x2f\x74\x64\x3e"; reg = new Regex(RegStr, RegexOptions.Singleline); Match m = reg.Match(MatchingScript); string target = m.Groups[1].Value;
可以看一下下面这篇文章和demo,上面讲述了如何搜索网页重的key words,应该对你有用
http://www.codeproject.com/aspnet/SearchDotnet.asp
string MatchingScript = rs.ReadLine();
RegStr="\x3c\x74\x64\x3e(.*|\n)\x3c\x2f\x74\x64\x3e";
reg = new Regex(RegStr, RegexOptions.Singleline);
Match m = reg.Match(MatchingScript);
string target = m.Groups[1].Value;