示例#1
0
 private void ReadXML()
 {
     _dsConfig = new dsSettings();
     try
     {
         _dsConfig.ReadXml(_sFilepath);
     }
     catch
     {
         //write new config file
         _dsConfig.WriteXml(_sFilepath);
     }
 }
示例#2
0
        private void WriteXML()
        {
            // Create the FileStream to write with.
            System.IO.FileStream myFileStream = new System.IO.FileStream(_sFilepath, System.IO.FileMode.Create);

            // Create an XmlTextWriter with the fileStream.
            System.Xml.XmlTextWriter myXmlWriter =
                new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode);

            // Write to the file with the WriteXml method.
            _dsConfig.WriteXml(myXmlWriter);
            myXmlWriter.Close();
        }