//插入任务信息到任务索引文件,返回新建任务索引的任务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); }
//����������Ϣ�����������ļ��������½���������������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; }
private void CreateTaskIndex(string tPath) { Task.cTaskIndex tIndex = new Task.cTaskIndex(); tIndex.NewIndexFile(tPath); tIndex = null; }