Esempio n. 1
0
 /// <summary>
 /// 分隔记录
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SplitRecord(object sender, System.EventArgs e)
 {
     try
     {
         DrillRegularRule sDrillRule = new DrillRegularRule();
         sDrillRule.StartTag  = TxtStartTag.Text.Trim();
         sDrillRule.EndTag    = TxtEndTag.Text.Trim();
         sDrillRule.DrillType = 2;
         sDrillRule.Splitter  = TxtSpliter.Text.Trim();
         mRecordHtmls         = new RegScriptTransactor(mHtml).GetRecordHtmls(sDrillRule);
         if (mRecordHtmls != null && mRecordHtmls.Length > 0)
         {
             TxtTotal.Text = mRecordHtmls.Length.ToString();
             ShowRecord(0);
         }
         else
         {
             TxtTotal.Text = "0";
             ShowRecord(-1);
         }
     }
     catch (Exception E)
     {
         MessageBox.Show(E.Message, "提示信息");
     }
 }
Esempio n. 2
0
 private void link选择提取模板_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (TViewRegion.SelectedNode != null && DlgOpen.ShowDialog() == DialogResult.OK)
     {
         PageDrillRagularRule sPageDrillRule    = PageDrillRagularRule.Open(DlgOpen.FileName);
         DrillRegularRule     sDrillRagularRule = sPageDrillRule.ToDrillRegularRule();
         TViewRegion.SelectedNode.Tag = sDrillRagularRule;
         LoadDrillRule(sDrillRagularRule);
     }
 }
Esempio n. 3
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            RegScriptTransactor sRegScriptTransactor = new RegScriptTransactor(mTree.Html);
            DrillRegularRule    sDrillRule           = new DrillRegularRule();

            sDrillRule.StartTag    = TxtStartTag.Text.Trim();
            sDrillRule.EndTag      = TxtEndTag.Text.Trim();
            sDrillRule.DrillType   = 0;
            sDrillRule.MetaModalID = SysDbDefines.载链接.DbModelID;
            sDrillRule.FeatureType = CmbLinkType.SelectedIndex;
            sDrillRule.Feature     = TxtUrlFeatrue.Text;
            string[]      sUrls = sRegScriptTransactor.GetUrls(sDrillRule, mTree.URL);
            List <string> sList = new List <string>();

            for (int i = 0; i < sUrls.Length; i++)
            {
                sList.Add((i + 1).ToString() + "." + sUrls[i]);
            }
            TxtTestResult0.Lines = sList.ToArray();
        }
Esempio n. 4
0
        /// <summary>
        /// 加载提取规则
        /// </summary>
        private void LoadDrillRule(DrillRegularRule pRule)
        {
            if (pRule != null)
            {
                mDrillRule = pRule;
            }
            else
            {
                mDrillRule = new DrillRegularRule();
            }
            CmbConditionType.SelectedIndex = mDrillRule.ConditionType;
            TxtConditionTag.Text           = mDrillRule.ConditionTag;

            TxtStartTag.Text = mDrillRule.StartTag;
            TxtEndTag.Text   = mDrillRule.EndTag;
            if (mDrillRule.DrillType == 0)
            {
                tabControl3.SelectedIndex = 0;   //提取类型
            }
            else
            {
                tabControl3.SelectedIndex = 1;   //提取类型
            }
            #region 链接提取模式
            CmbLinkType.SelectedIndex = mDrillRule.FeatureType;
            TxtUrlFeatrue.Text        = mDrillRule.Feature;
            #endregion

            #region 高级提取模式
            CDbDefine sCDbDefine = CommonDbServer.GetModalDbByID(mDrillRule.MetaModalID);
            TxtMeta.Text    = sCDbDefine.DbName;
            TxtMeta.Tag     = sCDbDefine;
            TxtSpliter.Text = mDrillRule.Splitter;
            SplitRecord(null, null);
            #endregion
        }