public bool DataSetToXML(DataSet _dataSet)
 {
     bool flag;
     if ((_dataSet == null) || (_dataSet.Tables.Count <= 0))
     {
         this.errorMessage = "数据集为空或者无数据";
         return false;
     }
     string[] strArray = this.fullFileName.Split(new char[] { '\\' });
     string path = "";
     for (int i = 0; i < (strArray.Length - 1); i++)
     {
         if (i == (strArray.Length - 2))
         {
             path = path + strArray[i];
         }
         else
         {
             path = path + strArray[i] + @"\";
         }
     }
     XmlTextWriter writer = null;
     try
     {
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         if (File.Exists(this.fullFileName))
         {
             File.Delete(this.fullFileName);
         }
         File.Open(this.fullFileName, FileMode.CreateNew, FileAccess.Write, FileShare.Write).Close();
         writer = new XmlTextWriter(this.fullFileName, Encoding.UTF8)
         {
             Formatting = Formatting.Indented
         };
         writer.WriteStartDocument();
         writer.WriteStartElement("DS");
         writer.WriteAttributeString("Name", _dataSet.GetHashCode().ToString());
         writer.WriteAttributeString("Num", _dataSet.Tables.Count.ToString());
         foreach (DataTable table in _dataSet.Tables)
         {
             writer.WriteStartElement("DT");
             writer.WriteAttributeString("Name", table.TableName);
             writer.WriteAttributeString("Num", table.Rows.Count.ToString());
             if (table.Rows.Count == 0)
             {
                 writer.WriteStartElement("DR");
                 writer.WriteAttributeString("Name", "1");
                 writer.WriteAttributeString("Num", "-1");
                 foreach (DataColumn column in table.Columns)
                 {
                     writer.WriteStartElement("DC");
                     writer.WriteAttributeString("Name", column.ColumnName);
                     writer.WriteAttributeString("Num", "0");
                     writer.WriteEndElement();
                 }
                 writer.WriteEndElement();
             }
             else
             {
                 foreach (DataRow row in table.Rows)
                 {
                     writer.WriteStartElement("DR");
                     writer.WriteAttributeString("Name", row.GetHashCode().ToString());
                     writer.WriteAttributeString("Num", table.Columns.Count.ToString());
                     foreach (DataColumn column in table.Columns)
                     {
                         writer.WriteStartElement("DC");
                         writer.WriteAttributeString("Name", column.ColumnName);
                         writer.WriteAttributeString("Num", "0");
                         writer.WriteString(row[column.ColumnName].ToString().Replace("<", "(!lt!)").Replace(">", "(!gt!)"));
                         writer.WriteEndElement();
                     }
                     writer.WriteEndElement();
                 }
             }
             writer.WriteEndElement();
         }
         writer.WriteEndElement();
         writer.WriteEndDocument();
         flag = true;
     }
     catch (Exception exception)
     {
         this.errorMessage = exception.Message;
         flag = false;
     }
     finally
     {
         if (writer != null)
         {
             writer.Close();
         }
     }
     return flag;
 }