using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.UI;
using System.Web.UI.WebControls;public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       if (!string.IsNullOrEmpty(Request.Form["value"]))
            {
                BF_GJPT_WebService.BF_GJPT_WebService BF = new BF_GJPT_WebService.BF_GJPT_WebService();
                string str = Request.Form["value"];
                //string str = TextArea1.Value;
                str = str.Replace("\n", "\r");
                string path = BF.GetHtml(str);                DataTable dt = SqlHelper.GetTable("select * from getHtml");
                string regex = dt.Rows[0]["Regex"].ToString();
                MatchCollection mc1 = Regex.Matches(path, regex);
                JavaScriptSerializer js = new JavaScriptSerializer();
                //string json = "";
                List<result02> list = new List<result02>();
                for (int i = 0; i < 20; i++)
                {
                    result02 m = new result02();
                    m.zhc = mc1[i].Groups[1].ToString();
                    m.zdcp = mc1[i].Groups[2].ToString();
                    m.price = mc1[i].Groups[3].ToString();
                    m.dl = mc1[i].Groups[4].ToString();
                    m.jl = mc1[i].Groups[5].ToString();
                    m.dz = mc1[i].Groups[6].ToString();
                    m.kpf = mc1[i].Groups[7].ToString();
                    m.dzjs = mc1[i].Groups[8].ToString();
                    m.sytj = mc1[i].Groups[9].ToString() + mc1[i].Groups[10].ToString();
                    m.cpsj = mc1[i].Groups[11].ToString();
                    list.Add(m);
                }
                //string s = js.Serialize(new { total = 20, rows = list });
                Response.Write(js.Serialize(list));
                Response.End();
            }        }
  }
这是后台