Exemplo n.º 1
0
        //插入任务信息到任务索引文件,返回新建任务索引的任务id
        public int InsertTaskIndex(string tPath)
        {
            cTaskIndex tIndex;

            //判断此路径下是否存在任务的索引文件
            if (!IsExistTaskIndex(tPath))
            {
                //如果不存在索引文件,则需要建立一个文件
                tIndex = new cTaskIndex();
                tIndex.NewIndexFile(tPath);
            }
            else
            {
                tIndex = new cTaskIndex(tPath + "\\index.xml");
            }

            tIndex.GetTaskDataByClass(this.TaskClass);

            int MaxTaskID = tIndex.GetTaskClassCount();

            //构造TaskIndex文件内容,此部分内容应该包含在TaskIndex类中
            string indexXml = "<id>" + MaxTaskID + "</id>" +
                              "<Name>" + this.TaskName + "</Name>" +
                              "<Type>" + this.TaskType + "</Type>" +
                              "<RunType>" + this.RunType + "</RunType>" +
                              "<ExportFile>" + this.ExportFile + "</ExportFile>" +
                              "<WebLinkCount>" + this.UrlCount + "</WebLinkCount>" +
                              "<IsLogin>" + this.IsLogin + "</IsLogin>" +
                              "<PublishType>" + this.ExportType + "</PublishType>";

            tIndex.InsertTaskIndex(indexXml);
            tIndex = null;

            return(MaxTaskID);
        }
Exemplo n.º 2
0
        //删除一个任务
        //删除任务的时候,系统会做一个处理,就是自动备份一个
        //任务文件,已~
        public bool DeleTask(string TaskPath, string TaskName)
        {
            //首先删除此任务所在分类下的index.xml中的索引内容然后再删除具体的任务文件
            string tPath = "";

            if (TaskPath == "")
            {
                tPath = Program.getPrjPath() + "Tasks";
            }
            else
            {
                tPath = TaskPath;
            }

            //先删除索引文件中的任务索引内容
            cTaskIndex tIndex = new cTaskIndex(tPath + "\\index.xml");

            tIndex.DeleTaskIndex(TaskName);
            tIndex = null;

            //如果是编辑状态,为了防止删除了文件后,任务保存失败,则
            //任务文件将丢失的问题,首先先不删除此文件,只是将其改名

            //删除任务的物理文件
            string FileName    = TaskPath + "\\" + TaskName + ".xml";
            string tmpFileName = TaskPath + "\\~" + TaskName + ".xml";

            try
            {
                //删除物理临时文件
                if (File.Exists(tmpFileName))
                {
                    File.SetAttributes(tmpFileName, System.IO.FileAttributes.Normal);
                    System.IO.File.Delete(tmpFileName);
                }

                System.IO.File.Move(FileName, tmpFileName);
            }
            catch (System.Exception)
            {
                //如果出现临时文件备份操作失败,则继续进行,不能影响到最终的文件保存
                //但如果文件保存也失败,那只能报错了
            }

            //删除物理任务文件
            if (File.Exists(FileName))
            {
                File.SetAttributes(FileName, System.IO.FileAttributes.Normal);
                System.IO.File.Delete(FileName);
            }

            //将文件设置为隐藏
            //System.IO.File.SetAttributes(tmpFileName, System.IO.FileAttributes.Hidden);
            return(true);
        }
        private void comTaskClass_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.listTask.Items.Clear();

            try
            {

                ListViewItem litem;
                int TaskClassID = 0;

                int Starti = this.comTaskClass.SelectedItem.ToString().IndexOf("-");

                TaskClassID = int.Parse(this.comTaskClass.SelectedItem.ToString().Substring((Starti + 1), (this.comTaskClass.SelectedItem.ToString().Length - Starti - 1)));

                Task.cTaskIndex xmlTasks = new Task.cTaskIndex();
                xmlTasks.GetTaskDataByClass(TaskClassID);

                //��ʼ��ʼ���˷����µ�����
                int count = xmlTasks.GetTaskClassCount();
                this.listTask.Items.Clear();

                for (int i = 0; i < count; i++)
                {
                    litem = new ListViewItem();
                    litem.Name = "S" + xmlTasks.GetTaskID(i);
                    litem.Text = xmlTasks.GetTaskName(i);
                    litem.SubItems.Add(this.comTaskClass.SelectedItem.ToString().Substring(0, this.comTaskClass.SelectedItem.ToString().IndexOf("-")).Trim());
                    litem.SubItems.Add(cGlobalParas.ConvertName(int.Parse(xmlTasks.GetTaskType(i))));
                    litem.SubItems.Add(cGlobalParas.ConvertName(int.Parse(xmlTasks.GetTaskRunType(i))));
                    litem.ImageIndex = 0;
                    this.listTask.Items.Add(litem);
                    litem = null;
                }
                xmlTasks = null;
            }

            catch (System.IO.IOException)
            {
                MessageBox.Show(rm.GetString("Info72"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info73"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
        }
Exemplo n.º 4
0
        private void comTaskClass_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.listTask.Items.Clear();

            try
            {
                ListViewItem litem;
                int          TaskClassID = 0;

                int Starti = this.comTaskClass.SelectedItem.ToString().IndexOf("-");

                TaskClassID = int.Parse(this.comTaskClass.SelectedItem.ToString().Substring((Starti + 1), (this.comTaskClass.SelectedItem.ToString().Length - Starti - 1)));

                Task.cTaskIndex xmlTasks = new Task.cTaskIndex();
                xmlTasks.GetTaskDataByClass(TaskClassID);

                //开始初始化此分类下的任务
                int count = xmlTasks.GetTaskClassCount();
                this.listTask.Items.Clear();

                for (int i = 0; i < count; i++)
                {
                    litem      = new ListViewItem();
                    litem.Name = "S" + xmlTasks.GetTaskID(i);
                    litem.Text = xmlTasks.GetTaskName(i);
                    litem.SubItems.Add(this.comTaskClass.SelectedItem.ToString().Substring(0, this.comTaskClass.SelectedItem.ToString().IndexOf("-")).Trim());
                    litem.SubItems.Add(cGlobalParas.ConvertName(int.Parse(xmlTasks.GetTaskType(i))));
                    litem.SubItems.Add(cGlobalParas.ConvertName(int.Parse(xmlTasks.GetTaskRunType(i))));
                    litem.ImageIndex = 0;
                    this.listTask.Items.Add(litem);
                    litem = null;
                }
                xmlTasks = null;
            }

            catch (System.IO.IOException)
            {
                MessageBox.Show(rm.GetString("Info72"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info73"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
        }
Exemplo n.º 5
0
        //根据taskid修改任务的名称
        public bool RenameTask(string TClass, string OldTaskName, string NewTaskName)
        {
            try
            {
                //根据任务分类获取任务的所属路径
                cTaskClass tc         = new cTaskClass();
                string     tClassPath = "";

                //判断新的任务路径是否存在,如果存在则报错
                if (TClass == "")
                {
                    tClassPath = Program.getPrjPath() + "tasks";
                }
                else
                {
                    tClassPath = tc.GetTaskClassPathByName(TClass);
                }

                tc = null;

                if (File.Exists(tClassPath + "\\" + NewTaskName + ".xml"))
                {
                    throw new cSoukeyException("您修改的任务名称已经存在,请重新修改!");
                }

                cTaskIndex xmlTasks = new cTaskIndex();

                if (TClass == "")
                {
                    xmlTasks.GetTaskDataByClass();
                }
                else
                {
                    xmlTasks.GetTaskDataByClass(TClass);
                }

                //开始初始化此分类下的任务
                int count = xmlTasks.GetTaskClassCount();

                for (int i = 0; i < count; i++)
                {
                    if (xmlTasks.GetTaskName(i) == NewTaskName)
                    {
                        xmlTasks = null;
                        throw new cSoukeyException("您修改的任务名称已经存在,请重新修改!");
                    }
                }
                xmlTasks = null;

                //开始修改任务的名称
                //先开始修改index.xml的名称
                cXmlIO xmlIndex = new cXmlIO(tClassPath + "\\index.xml");
                xmlIndex.EditNodeValue("TaskIndex", "Name", OldTaskName, "Name", NewTaskName);
                xmlIndex.Save();
                xmlIndex = null;

                //开始修改任务的名称
                cXmlIO xmlTask = new cXmlIO(tClassPath + "\\" + OldTaskName + ".xml");
                xmlTask.EditNodeValue("Task/BaseInfo/Name", NewTaskName);
                xmlTask.Save();
                xmlTask = null;

                File.SetAttributes(tClassPath + "\\" + OldTaskName + ".xml", System.IO.FileAttributes.Normal);
                File.Move(tClassPath + "\\" + OldTaskName + ".xml", tClassPath + "\\" + NewTaskName + ".xml");
            }
            catch (System.Exception ex)
            {
                throw ex;
                return(false);
            }

            return(true);
        }
Exemplo n.º 6
0
        //����taskid�޸����������
        public bool RenameTask(string TClass,string OldTaskName, string NewTaskName)
        {
            try
            {
                //������������ȡ���������·��
                cTaskClass tc = new cTaskClass();
                string tClassPath = "";

                //�ж��µ�����·���Ƿ���ڣ���������򱨴�
                if (TClass == "")
                {
                    tClassPath = Program.getPrjPath() + "tasks";
                }
                else
                {
                    tClassPath = tc.GetTaskClassPathByName(TClass);
                }

                tc = null;

                if (File.Exists(tClassPath + "\\" + NewTaskName + ".xml"))
                    throw new cSoukeyException("���޸ĵ����������Ѿ����ڣ��������޸ģ�");

                cTaskIndex xmlTasks = new cTaskIndex();

                if (TClass == "")
                {
                    xmlTasks.GetTaskDataByClass();
                }
                else
                {
                    xmlTasks.GetTaskDataByClass(TClass);
                }

                //��ʼ��ʼ���˷����µ�����
                int count = xmlTasks.GetTaskClassCount();

                for (int i = 0; i < count; i++)
                {
                    if (xmlTasks.GetTaskName(i) == NewTaskName)
                    {
                        xmlTasks = null;
                        throw new cSoukeyException("���޸ĵ����������Ѿ����ڣ��������޸ģ�");
                    }
                }
                xmlTasks = null;

                //��ʼ�޸����������
                //�ȿ�ʼ�޸�index.xml������
                cXmlIO xmlIndex = new cXmlIO(tClassPath + "\\index.xml");
                xmlIndex.EditNodeValue("TaskIndex", "Name", OldTaskName, "Name", NewTaskName);
                xmlIndex.Save();
                xmlIndex = null;

                //��ʼ�޸����������
                cXmlIO xmlTask = new cXmlIO(tClassPath + "\\" + OldTaskName + ".xml");
                xmlTask.EditNodeValue("Task/BaseInfo/Name", NewTaskName);
                xmlTask.Save();
                xmlTask = null;

                File.SetAttributes(tClassPath + "\\" + OldTaskName + ".xml", System.IO.FileAttributes.Normal);
                File.Move(tClassPath + "\\" + OldTaskName + ".xml", tClassPath + "\\" + NewTaskName + ".xml");
            }
            catch (System.Exception ex)
            {
                throw ex;
                return false;
            }

            return true;
        }
Exemplo n.º 7
0
        //����������Ϣ�����������ļ��������½���������������id
        public int InsertTaskIndex(string tPath)
        {
            cTaskIndex tIndex;

            //�жϴ�·�����Ƿ��������������ļ�
            if (!IsExistTaskIndex(tPath))
            {
                //��������������ļ�������Ҫ����һ���ļ�
                tIndex = new cTaskIndex();
                tIndex.NewIndexFile(tPath);
            }
            else
            {
                tIndex = new cTaskIndex(tPath + "\\index.xml");
            }

            tIndex.GetTaskDataByClass(this.TaskClass);

            int MaxTaskID = tIndex.GetTaskClassCount();

            //����TaskIndex�ļ�����,�˲�������Ӧ�ð�����TaskIndex����
            string indexXml = "<id>" + MaxTaskID + "</id>" +
                    "<Name>" + this.TaskName + "</Name>" +
                    "<Type>" + this.TaskType + "</Type>" +
                    "<RunType>" + this.RunType + "</RunType>" +
                    "<ExportFile>" + this.ExportFile + "</ExportFile>" +
                    "<WebLinkCount>" + this.UrlCount + "</WebLinkCount>" +
                    "<IsLogin>" + this.IsLogin + "</IsLogin>" +
                    "<PublishType>" + this.ExportType + "</PublishType>";
            tIndex.InsertTaskIndex(indexXml);
            tIndex = null;

            return MaxTaskID;
        }
Exemplo n.º 8
0
        //ɾ��һ������
        //ɾ�������ʱ��ϵͳ����һ������������Զ�����һ��
        //�����ļ�����~
        public bool DeleTask(string TaskPath,string TaskName)
        {
            //����ɾ�����������ڷ����µ�index.xml�е���������Ȼ����ɾ������������ļ�
            string tPath = "";

            if (TaskPath == "")
            {
                tPath = Program.getPrjPath() + "Tasks";
            }
            else
            {
                tPath = TaskPath;
            }

            //��ɾ�������ļ��е�������������
            cTaskIndex tIndex = new cTaskIndex(tPath + "\\index.xml");
            tIndex.DeleTaskIndex(TaskName);
            tIndex =null;

            //����DZ༭״̬��Ϊ�˷�ֹɾ�����ļ������񱣴�ʧ�ܣ���
            //�����ļ�����ʧ�����⣬�����Ȳ�ɾ�����ļ���ֻ�ǽ������

            //ɾ������������ļ�
            string FileName =TaskPath   + "\\" + TaskName + ".xml" ;
            string tmpFileName=TaskPath   + "\\~" + TaskName + ".xml" ;

            try
            {
                //ɾ��������ʱ�ļ�
                if (File.Exists(tmpFileName))
                {
                    File.SetAttributes(tmpFileName, System.IO.FileAttributes.Normal);
                    System.IO.File.Delete(tmpFileName);
                }

                System.IO.File.Move(FileName, tmpFileName);

            }
            catch (System.Exception )
            {
                //���������ʱ�ļ����ݲ���ʧ�ܣ���������У�����Ӱ�쵽���յ��ļ�����
                //������ļ�����Ҳʧ�ܣ���ֻ�ܱ�����
            }

            //ɾ�����������ļ�
            if (File.Exists(FileName))
            {
                File.SetAttributes(FileName, System.IO.FileAttributes.Normal);
                System.IO.File.Delete(FileName);
            }

            //���ļ�����Ϊ����
            //System.IO.File.SetAttributes(tmpFileName, System.IO.FileAttributes.Hidden);
            return true;
        }
        public void AutoAddTask()
        {
            //��ȡ���з��࣬Ȼ����ݷ����������
            cTaskClass xmlTClass = new cTaskClass();
            cTaskIndex xmlTasks;

            //��ȡ���ж��ٸ��������
            int TClassCount = xmlTClass.GetTaskClassCount();

            for (int i = 0; i < TClassCount; i++)
            {
                xmlTasks = new cTaskIndex();

                //��ȡ�˷����¹��й��ٸ�����
                xmlTasks.GetTaskDataByClass(xmlTClass.GetTaskClassName(i));

                int count = xmlTasks.GetTaskClassCount();

                cTask t;

                ListViewItem Litem;

                for (int j = 0; j < count; j++)
                {
                    t = new cTask();
                    try
                    {
                        t.LoadTask(xmlTClass.GetTaskClassPathByName(xmlTClass.GetTaskClassName(i)) + "\\" + xmlTasks.GetTaskName(j) + ".xml");
                        t = null;
                    }
                    catch (cSoukeyException)
                    {
                        Litem = new ListViewItem();

                        Litem.ImageIndex = 0;
                        Litem.Text = "�ȴ�����";
                        Litem.SubItems.Add(xmlTasks.GetTaskName(j));
                        Litem.SubItems.Add(t.TaskVersion.ToString());
                        Litem.SubItems.Add(xmlTClass.GetTaskClassName(i));
                        Litem.SubItems.Add(xmlTClass.GetTaskClassPathByName(xmlTClass.GetTaskClassName(i)));
                        Litem.SubItems.Add("");
                        //���½�������Ϣ
                        m_sender.BeginInvoke(m_senderDelegate, new object[] { TClassCount + count, j + i, Litem, false });

                        Application.DoEvents();
                    }
                    catch (System.Exception ex)
                    {

                    }

                }

                //���½�������Ϣ
                m_sender.BeginInvoke(m_senderDelegate, new object[] { TClassCount, i, null, false });
            }

            m_sender.BeginInvoke(m_senderDelegate, new object[] { TClassCount, TClassCount,null, true  });

            xmlTClass = null;
        }
Exemplo n.º 10
0
        //���������������������������½�һ�����࣬����ԭ�з��������
        //Ǩ�ƹ��������޸�������Ϣ�����񣬲�ɾ��ԭ������
        public bool RenameTaskClass(string TClassName, string NewTClassName)
        {
            try
            {
                int OldTaskClassID=0;
                string OldPath = GetTaskClassPathByName(TClassName);
                string NewPath = OldPath.Substring(0, OldPath.IndexOf(TClassName)) + NewTClassName;

                //�ж��µ�����·���Ƿ���ڣ���������򱨴�
                if (Directory.Exists (NewPath ))
                    throw new cSoukeyException("����������·���Ѿ����ڣ��������޸�����������ƣ�");

                //ת�����·��
                string NewRelativePath = cTool.GetRelativePath(NewPath);

                int tCount = GetTaskClassCount();

                //��Ҫ�ж��½�������������Ƿ��Ѿ�����
                for (int i = 0; i < tCount; i++)
                {
                    if (TaskClass[i].Row["Name"].ToString() == NewTClassName)
                    {
                        throw new cSoukeyException("��������Ѿ����ڣ�");
                    }

                     if (TaskClass[i].Row["Name"].ToString() == TClassName)
                    {
                         //��ȡԭ�з����ID
                         OldTaskClassID=GetTaskClassID (i);
                    }
                }

                if (OldTaskClassID == 0)
                {
                    throw new cSoukeyException("δ���ҵ���Ҫ�޸ķ������Ϣ�������޸�ʧ�ܣ�");
                }

                //��ʼ�޸���������µ�����������������
                cTaskIndex xmlTasks = new cTaskIndex();
                xmlTasks.GetTaskDataByClass(TClassName);

                //��ʼ��ʼ���˷����µ�����
                int count = xmlTasks.GetTaskClassCount();

                cXmlIO txml;

                for (int i = 0; i < count; i++)
                {
                    txml = new cXmlIO(OldPath + "\\" + xmlTasks.GetTaskName(i) + ".xml");
                    txml.EditNodeValue("Task/BaseInfo/Class", NewTClassName);
                    txml.Save();
                    txml = null;
                }

                xmlTasks = null;

                //��ʼ�޸�taskclass.xml�ļ��е��������������Ϣ
                xmlConfig.EditNodeValue("TaskClasses", "id", OldTaskClassID.ToString (), "Name", NewTClassName);
                xmlConfig.EditNodeValue("TaskClasses", "id", OldTaskClassID.ToString (), "Path", NewRelativePath);
                xmlConfig.Save();
                xmlConfig = null;

                //��ʼ���޸���������ʵ��·��
                File.SetAttributes(OldPath, System.IO.FileAttributes.Normal);
                Directory.Move(OldPath, NewPath);
                //Directory.Delete(OldPath);

            }
            catch (System.Exception ex)
            {
                throw ex;
                return false;
            }

            return true;
        }
Exemplo n.º 11
0
        private void LoadTask(TreeNode  mNode)
        {
            ShowTaskInfo();

            Task.cTaskIndex xmlTasks = new Task.cTaskIndex();

            if (mNode.Name == "nodTaskClass")
            {
                xmlTasks.GetTaskDataByClass();
            }
            else
            {
                //������޷���֤id��Ψһ�ԣ����ԣ����е�����ȫ��������������ȡ
                string TaskClassName = mNode.Text;
                xmlTasks.GetTaskDataByClass(TaskClassName);
            }

            //��ʼ��ʼ���˷����µ�����
            int count = xmlTasks.GetTaskClassCount();

            for (int i = 0; i < count; i++)
            {
                if (xmlTasks.GetTaskState(i) == cGlobalParas.TaskState.Failed)
                {

                    dataTask.Rows.Add(imageList1.Images["error"], xmlTasks.GetTaskID(i), xmlTasks.GetTaskState(i), this.treeMenu.SelectedNode.Name, xmlTasks.GetTaskName(i),
                        "", "",
                       "","",
                       "�������ʧ�ܣ���ɾ�����ؽ���");
                    dataTask.Rows[dataTask.Rows.Count - 1].DefaultCellStyle = this.m_RowStyleErr;

                }
                else
                {
                    dataTask.Rows.Add(imageList1.Images["task"], xmlTasks.GetTaskID(i), xmlTasks.GetTaskState(i), this.treeMenu.SelectedNode.Name, xmlTasks.GetTaskName(i),
                        cGlobalParas.ConvertName(int.Parse(xmlTasks.GetTaskType(i).ToString())), (xmlTasks.GetIsLogin(i) == true ? rm.GetString("Logon") : rm.GetString("NoLogon")),
                       xmlTasks.GetWebLinkCount(i).ToString(), cGlobalParas.ConvertName(int.Parse(xmlTasks.GetTaskRunType(i).ToString())),
                       cGlobalParas.ConvertName((int)xmlTasks.GetPublishType(i)));
                }
            }
            xmlTasks = null;

            this.dataTask.Sort(this.dataTask.Columns[4], ListSortDirection.Ascending);

            this.dataTask.ClearSelection();
        }
Exemplo n.º 12
0
 private void CreateTaskIndex(string tPath)
 {
     Task.cTaskIndex tIndex = new Task.cTaskIndex();
     tIndex.NewIndexFile(tPath);
     tIndex = null;
 }
Exemplo n.º 13
0
        //任务分类改名,任务分类改名就是新建一个分类,并把原有分类的任务都
        //迁移过来,并修改任务信息的任务,并删除原有内容
        public bool RenameTaskClass(string TClassName, string NewTClassName)
        {
            try
            {
                int    OldTaskClassID = 0;
                string OldPath        = GetTaskClassPathByName(TClassName);
                string NewPath        = OldPath.Substring(0, OldPath.IndexOf(TClassName)) + NewTClassName;

                //判断新的任务路径是否存在,如果存在则报错
                if (Directory.Exists(NewPath))
                {
                    throw new cSoukeyException("新任务分类的路径已经存在,请重新修改任务分类名称!");
                }

                //转换相对路径
                string NewRelativePath = cTool.GetRelativePath(NewPath);

                int tCount = GetTaskClassCount();

                //需要判断新建立的任务分类是否已经存在
                for (int i = 0; i < tCount; i++)
                {
                    if (TaskClass[i].Row["Name"].ToString() == NewTClassName)
                    {
                        throw new cSoukeyException("任务分类已经存在!");
                    }

                    if (TaskClass[i].Row["Name"].ToString() == TClassName)
                    {
                        //获取原有分类的ID
                        OldTaskClassID = GetTaskClassID(i);
                    }
                }

                if (OldTaskClassID == 0)
                {
                    throw new cSoukeyException("未能找到需要修改分类的信息,名称修改失败!");
                }

                //开始修改任务分类下的所有任务的所属分类
                cTaskIndex xmlTasks = new cTaskIndex();
                xmlTasks.GetTaskDataByClass(TClassName);

                //开始初始化此分类下的任务
                int count = xmlTasks.GetTaskClassCount();

                cXmlIO txml;

                for (int i = 0; i < count; i++)
                {
                    txml = new cXmlIO(OldPath + "\\" + xmlTasks.GetTaskName(i) + ".xml");
                    txml.EditNodeValue("Task/BaseInfo/Class", NewTClassName);
                    txml.Save();
                    txml = null;
                }

                xmlTasks = null;

                //开始修改taskclass.xml文件中的任务分类索引信息
                xmlConfig.EditNodeValue("TaskClasses", "id", OldTaskClassID.ToString(), "Name", NewTClassName);
                xmlConfig.EditNodeValue("TaskClasses", "id", OldTaskClassID.ToString(), "Path", NewRelativePath);
                xmlConfig.Save();
                xmlConfig = null;

                //开始将修改任务分类的实际路径
                File.SetAttributes(OldPath, System.IO.FileAttributes.Normal);
                Directory.Move(OldPath, NewPath);
                //Directory.Delete(OldPath);
            }
            catch (System.Exception ex)
            {
                throw ex;
                return(false);
            }

            return(true);
        }