예제 #1
0
        /// <summary>设置时分秒组合框列表内容</summary>
        /// <param name="cbs">时组合框</param>
        /// <param name="cbf">分组合框</param>
        /// <param name="cbm">秒组合框</param>
        /// <param name="tst">秒分秒字符串</param>
        public static void SetTimeComboBox(ComboBox cbs, ComboBox cbf, ComboBox cbm, string tst)
        {
            bool istst = false;

            if (tst != "")
            {
                string[] tarr = tst.Split(':');
                if (tarr.Length == 3)
                {
                    string s = tarr[0].Trim();
                    string f = tarr[1].Trim();
                    string m = tarr[2].Trim();
                    if (Often.IsInt32(s) && Often.IsInt32(f) && Often.IsInt32(m))
                    {
                        AppPub.SetComboBoxItems(cbs, AppList.Hour(), s);
                        AppPub.SetComboBoxItems(cbf, AppList.Minute(), f);
                        AppPub.SetComboBoxItems(cbm, AppList.Minute(), m);
                        istst = true;
                    }
                }
            }
            if (!istst)
            {
                AppPub.SetComboBoxItems(cbs, AppList.Hour(), "0");
                AppPub.SetComboBoxItems(cbf, AppList.Minute(), "0");
                AppPub.SetComboBoxItems(cbm, AppList.Minute(), "0");
            }
        }
예제 #2
0
        /// <summary>读取网络蜘蛛设置</summary>
        /// <param name="wsid">网络蜘蛛ID</param>
        public void LoadWebSpiderInfo(string wsid)
        {
            IsLoad   = false;
            SpiderID = wsid;
            DataRow[] sdrs = wapp.WebSpiderList.WebSpiderTable.Select("SpiderID='" + wsid + "'");
            if (sdrs.Length <= 0)
            {
                return;
            }
            ws                       = new WebSpider();
            ws.SpiderID              = DataOften.GetStr(sdrs, "SpiderID");
            ws.SpiderName            = DataOften.GetStr(sdrs, "SpiderName");
            ws.UrlList               = DataOften.GetStr(sdrs, "UrlList");
            ws.UrlRangeRule          = DataOften.GetStr(sdrs, "UrlRangeRule").Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
            ws.UrlRule               = DataOften.GetStr(sdrs, "UrlRule").Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
            ws.NextRangeRule         = DataOften.GetStr(sdrs, "NextRangeRule").Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
            ws.NextRule              = DataOften.GetStr(sdrs, "NextRule").Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
            ws.UrlRangeRuleIndex     = AppPub.GetInt(DataOften.GetStr(sdrs, "UrlRangeRuleIndex", "0"));
            ws.UrlRuleIndex          = AppPub.GetInt(DataOften.GetStr(sdrs, "UrlRuleIndex", "0"));
            ws.NextRangeRuleIndex    = AppPub.GetInt(DataOften.GetStr(sdrs, "NextRangeRuleIndex", "0"));
            ws.NextRuleIndex         = AppPub.GetInt(DataOften.GetStr(sdrs, "NextRuleIndex", "0"));
            ws.IsSaveHtml            = AppPub.GetInt(DataOften.GetStr(sdrs, "IsSaveHtml", "0"));
            ws.HtmlSavePath          = DataOften.GetStr(sdrs, "HtmlSavePath");
            ws.ExcelSavePath         = DataOften.GetStr(sdrs, "ExcelSavePath");
            ws.OrderNum              = AppPub.GetInt(DataOften.GetStr(sdrs, "OrderNum", "0"));
            ws.GatherCount           = AppPub.GetInt(DataOften.GetStr(sdrs, "GatherCount", "0"));
            ws.CodingMode            = AppPub.GetInt(DataOften.GetStr(sdrs, "CodingMode", "0"));
            ws.PageCoding            = DataOften.GetStr(sdrs, "PageCoding");
            ws.GatherMaxNum          = AppPub.GetInt(DataOften.GetStr(sdrs, "GatherMaxNum", "0"));
            ws.IsEcho                = AppPub.GetInt(DataOften.GetStr(sdrs, "IsEcho", "0"));
            ws.IsNext                = AppPub.GetInt(DataOften.GetStr(sdrs, "IsNext", "0"));
            ws.NextMode              = AppPub.GetInt(DataOften.GetStr(sdrs, "NextMode", "0"));
            ws.ConNextRangeRule      = DataOften.GetStr(sdrs, "ConNextRangeRule").Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
            ws.ConNextRule           = DataOften.GetStr(sdrs, "ConNextRule").Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
            ws.ConNextRangeRuleIndex = AppPub.GetInt(DataOften.GetStr(sdrs, "ConNextRangeRuleIndex", "0"));
            ws.ConNextRuleIndex      = AppPub.GetInt(DataOften.GetStr(sdrs, "ConNextRuleIndex", "0"));
            ws.ConIsNext             = AppPub.GetInt(DataOften.GetStr(sdrs, "ConIsNext", "0"));
            ws.ConNextMode           = AppPub.GetInt(DataOften.GetStr(sdrs, "ConNextMode", "0"));
            DataRow[] sidrs = wapp.WebSpiderInfoList.WebSpiderInfoTable.Select("SpiderID='" + wsid + "'");
            if (sidrs.Length <= 0)
            {
                return;
            }
            Table table = new Table("GTable");
            bool  iscol = false;

            for (int i = 0; i < sidrs.Length; i++)
            {
                WebSpiderInfo wsi = new wapp.WebSpiderInfo();
                wsi.ListID                = DataOften.GetStr(sidrs, "ListID", i);
                wsi.SpiderID              = DataOften.GetStr(sidrs, "SpiderID", i);
                wsi.ListTitle             = DataOften.GetStr(sidrs, "ListTitle", i);
                wsi.ListCode              = DataOften.GetStr(sidrs, "ListCode", i);
                wsi.ContentRangeRule      = DataOften.GetStr(sidrs, "ContentRangeRule", i).Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
                wsi.ContentRule           = DataOften.GetStr(sidrs, "ContentRule", i).Replace("\\[RegRuleZhyNoLabel88088]", "([\\S\\s][^<>]*?)").Replace("\\[RegRuleZhyLabel88088]", "([\\S\\s]*?)");
                wsi.ContentRangeRuleIndex = AppPub.GetInt(DataOften.GetStr(sidrs, "ContentRangeRuleIndex", i, "0"));
                wsi.ContentRuleIndex      = AppPub.GetInt(DataOften.GetStr(sidrs, "ContentRuleIndex", i, "0"));
                wsi.ContentFilt           = DataOften.GetStr(sidrs, "ContentFilt", i);
                wsi.ContentRegFilt        = DataOften.GetStr(sidrs, "ContentRegFilt", i);
                wsi.ContentType           = AppPub.GetInt(DataOften.GetStr(sidrs, "ContentType", i, "0"));
                wsi.OrderNum              = AppPub.GetInt(DataOften.GetStr(sidrs, "OrderNum", i, "0"));
                wsi.ContentCodeMode       = AppPub.GetInt(DataOften.GetStr(sidrs, "ContentCodeMode", i, "0"));
                if (wsi.ContentType == 1)
                {
                    table.Add(wsi.ListTitle, "double", 0);
                }
                else if (wsi.ContentType == 2)
                {
                    table.Add(wsi.ListTitle, "datetime", 0);
                }
                else
                {
                    table.Add(wsi.ListTitle, "string", 0);
                }
                wsilist.Add(wsi);
                iscol = true;
            }
            gdt = DataTables.GetDataTable(table);
            if (iscol)
            {
                IsLoad = true;
            }
        }