日期:2014-05-17 浏览次数:20796 次
//最前面加上using System.Text.RegularExpressions; string HTML = "<html>...<p><text>aaaaaa<text></p>...</html>"; // 你的html代码 string result = Regex.Match(HTML, @"<text>(.+?)<text>").Groups[1].Value; textBox1.Text = result;
------解决方案--------------------
//using System.Net; WebClient client = new WebClient(); string HTML = client.DownloadString("http://www.google.com"); ...
------解决方案--------------------
启用单行模式试试string result = Regex.Match(HTML, @"(?s)<br />(.+?)<br />").Groups[1].Value;