Пример #1
0
        //初始化运行区的采集任务信息.
        public void LoadTaskRunData()
        {
            Task.cTaskRun t = new Task.cTaskRun();
            t.LoadTaskRunData();
            cTaskData tData;

            for (int i = 0; i < t.GetCount(); i++)
            {
                tData                         = new cTaskData();
                tData.TaskID                  = t.GetTaskID(i);
                tData.TaskName                = t.GetTaskName(i);
                tData.TaskType                = t.GetTaskType(i);
                tData.RunType                 = t.GetTaskRunType(i);
                tData.tempFileName            = t.GetTempFile(i);
                tData.TaskState               = t.GetTaskState(i);
                tData.ThreadCount             = t.GetThreadCount(i);
                tData.UrlCount                = t.GetUrlCount(i);
                tData.TrueUrlCount            = t.GetTrueUrlCount(i);
                tData.GatheredUrlCount        = 0;
                tData.GatheredTrueUrlCount    = t.GetGatheredTrueUrlCount(i);
                tData.GatherErrUrlCount       = 0;
                tData.GatheredTrueErrUrlCount = t.GetTrueErrUrlCount(i);
                m_TaskDataList.Add(tData);
                tData = null;
            }

            m_TaskCount = t.GetCount();
            t           = null;
        }
        //��ʼ���������IJɼ�������Ϣ.
        public void LoadTaskRunData()
        {
            Task.cTaskRun t = new Task.cTaskRun();
            t.LoadTaskRunData();
            cTaskData tData;
            for (int i = 0; i < t.GetCount(); i++)
            {
                tData = new cTaskData();
                tData.TaskID = t.GetTaskID(i);
                tData.TaskName = t.GetTaskName(i);
                tData.TaskType = t.GetTaskType(i);
                tData.RunType = t.GetTaskRunType(i);
                tData.tempFileName = t.GetTempFile(i);
                tData.TaskState = t.GetTaskState(i);
                tData.ThreadCount = t.GetThreadCount(i);
                tData.UrlCount = t.GetUrlCount(i);
                tData.TrueUrlCount = t.GetTrueUrlCount(i);
                tData.GatheredUrlCount = 0;
                tData.GatheredTrueUrlCount = t.GetGatheredTrueUrlCount(i);
                tData.GatherErrUrlCount = 0;
                tData.GatheredTrueErrUrlCount = t.GetTrueErrUrlCount(i);
                m_TaskDataList.Add(tData);
                tData = null;
            }

            m_TaskCount = t.GetCount();
            t = null;
        }
Пример #3
0
        public Int64 InsertTaskComplete(Int64 TaskID, cGlobalParas.GatherResult tSate)
        {
            ///首先判断存放任务执行的目录是否存在
            ///此目录是固定目录,存放在系统\\data
            string cPath = Program.getPrjPath() + "data";

            if (!System.IO.Directory.Exists(cPath))
            {
                System.IO.Directory.CreateDirectory(cPath);
            }

            ///先将此任务的摘要信息加载到index.xml文件中
            Task.cTaskRun t = new Task.cTaskRun();
            t.LoadSingleTask(TaskID);

            //开始构造xml节点内容
            LoadTaskData();
            //int MaxID=GetCount () + 1;

            string txml = "";

            txml  = "<TaskID>" + t.GetTaskID(0) + "</TaskID>";
            txml += "<TaskName>" + t.GetTaskName(0) + "</TaskName>";
            txml += "<TaskState>" + tSate + "</TaskState>";
            txml += "<TaskType>" + (int)t.GetTaskType(0) + "</TaskType>";
            txml += "<RunType>" + (int)t.GetTaskRunType(0) + "</RunType>";
            txml += "<ExportFile>" + t.GetExportFile(0) + "</ExportFile>";
            txml += "<tempFile>" + t.GetTempFile(0) + "</tempFile>";
            txml += "<UrlCount>" + t.GetUrlCount(0) + "</UrlCount>";
            txml += "<GatheredUrlCount>" + t.GetGatheredUrlCount(0) + "</GatheredUrlCount>";
            txml += "<IsLogin>" + t.GetIsLogin(0) + "</IsLogin>";
            txml += "<PublishType>" + (int)t.GetPublishType(0) + "</PublishType>";

            xmlConfig.InsertElement("Tasks", "Task", txml);
            xmlConfig.Save();

            return(TaskID);
        }
        public Int64 InsertTaskComplete(Int64 TaskID,cGlobalParas.GatherResult tSate)
        {
            ///�����жϴ������ִ�е�Ŀ¼�Ƿ����
            ///��Ŀ¼�ǹ̶�Ŀ¼�������ϵͳ\\data
            string cPath = Program.getPrjPath() + "data";

            if (!System.IO.Directory.Exists(cPath))
            {
                System.IO.Directory.CreateDirectory(cPath);
            }

            ///�Ƚ��������ժҪ��Ϣ���ص�index.xml�ļ���
            Task.cTaskRun t = new Task.cTaskRun();
            t.LoadSingleTask(TaskID);

            //��ʼ����xml�ڵ�����
            LoadTaskData();
            //int MaxID=GetCount () + 1;

            string txml="";
            txml = "<TaskID>" + t.GetTaskID (0) + "</TaskID>";
            txml += "<TaskName>" + t.GetTaskName(0) + "</TaskName>";
            txml += "<TaskState>" + tSate + "</TaskState>";
            txml += "<TaskType>" + (int)t.GetTaskType(0) + "</TaskType>";
            txml += "<RunType>" + (int)t.GetTaskRunType(0) + "</RunType>";
            txml += "<ExportFile>" + t.GetExportFile(0) + "</ExportFile>";
            txml += "<tempFile>" + t.GetTempFile(0) + "</tempFile>";
            txml += "<UrlCount>" + t.GetUrlCount(0) + "</UrlCount>";
            txml += "<GatheredUrlCount>" + t.GetGatheredUrlCount(0) + "</GatheredUrlCount>";
            txml += "<IsLogin>" + t.GetIsLogin(0) + "</IsLogin>";
            txml += "<PublishType>" + (int)t.GetPublishType(0) + "</PublishType>";

            xmlConfig.InsertElement("Tasks", "Task", txml);
            xmlConfig.Save ();

            return TaskID;
        }