private static void BeginCollContent() { B_Model modBll = new B_Model(); B_ModelField fdBll = new B_ModelField(); B_CollectionItem itemBll = new B_CollectionItem(); foreach (M_CollectionItem item in workList) { if (B_Coll_Worker.work_switcher == false) { break; } if (string.IsNullOrEmpty(item.LinkList)) { WriteLog("项目[" + item.ItemName + "]取消,原因:未指定需要采集的列表URL,LinkList"); continue; } if (string.IsNullOrEmpty(item.InfoPageSettings)) { WriteLog("项目[" + item.ItemName + "]取消,原因:未指定字段采集规则"); continue; } if (string.IsNullOrEmpty(item.CollUrl)) { WriteLog("项目[" + item.ItemName + "]取消,原因:未指定采集来源网址CollUrl"); continue; } M_ModelInfo modMod = modBll.SelReturnModel(item.ModeID); DataTable fieldDT = fdBll.SelByModelID(item.ModeID); foreach (string url in item.LinkList.Split('\n')) { if (B_Coll_Worker.work_switcher == false) { WriteLog("采集项目[" + item.ItemName + "]已停止", ERROR); break; } if (string.IsNullOrEmpty(url)) { continue; } WriteLog("正在采集[" + item.ItemName + "]的目标网址[" + url + "]"); CollectByUrl(url, item, modMod, fieldDT); } DBCenter.UpdateSQL(item.TbName, "Switch=2", "CItem_ID=" + item.CItem_ID); } WriteLog("采集完成,共采集到[" + work_count + "]篇内容", 99); work_switcher = false; work_count = 0; workList.Clear(); }