例:
<p><table><tr>.....<tr></table></p>
<p><img src="1.jpg"></p>
<p><table><tr>.....<tr></table></p>我只想要<table>里的内容包括<table>,把这两组<table>放到string数组里面

解决方案 »

  1.   

    给p   两个属性 id="tab" raunt="server"在后台就可以用 tab.innerHTML()来获取了。 
      

  2.   

    直接给那两个Table分别设置id,也行!
      

  3.   

    设置id,,在后台可以用,,,在前端用js也行
      

  4.   

    我的不是ASP.Net,和网站没关系
      

  5.   

    winform里面,好像不能这样写吧。
      

  6.   

    Match me in Regex.Matches(contents, @"(?i)(?<=(<td>|<td>.*?(src|href)\s*=\s*""))[^>""]+?(?=(</td>|""(></a>|\s)))")
    是获取table中所有<td>的值
      

  7.   

    string str = File.ReadAllText(@"E:\download\网站测试.txt", Encoding.Default);
            Regex reg = new Regex(@"(?is)<table>.+?</table>");
           
            foreach (Match m in reg.Matches(str))
            {
                Response.Write(Server.HtmlEncode(m.Value));
            }
      

  8.   

     Regex reg = new Regex(@"(?is)<table>.+?</table>");
                 foreach (Match m in reg.Matches(s))
                 {
                     
                     MessageBox.Show(m.Value);
                 }
      

  9.   

    Regex reg = new Regex(@"(?is)<table>.+?</table>");
    string allM="";
      foreach (Match m in reg.Matches(s))
      {
       
      allM+=m.value+"|";
      }
    MessageBox.Show(allM);
    试试