//保存数据到xml文件
private void writeXml()
{
string fileName = Application.StartupPath+"\\SysSetting.xml";
XmlTextWriter tw = new XmlTextWriter(fileName,null);
//idented属性让子节点自动从父节点缩进
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument(); tw.WriteStartElement("Application");
tw.WriteElementString("DataConnection",this.connStr);
tw.WriteElementString("UnReceivePath",this.extbUnReceivedPath.Text);
tw.WriteElementString("ReceivedPath",this.extbRecivedPath.Text);
tw.WriteElementString("ErrorPath",this.extbErrorPath.Text);
tw.WriteElementString("NewPath",this.extbNewPath.Text);
tw.WriteElementString("LogFile",this.extbLogFile.Text); tw.WriteEndElement(); tw.WriteEndDocument(); tw.Flush();
tw.Close(); this.Close();
}
private void writeXml()
{
string fileName = Application.StartupPath+"\\SysSetting.xml";
XmlTextWriter tw = new XmlTextWriter(fileName,null);
//idented属性让子节点自动从父节点缩进
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument(); tw.WriteStartElement("Application");
tw.WriteElementString("DataConnection",this.connStr);
tw.WriteElementString("UnReceivePath",this.extbUnReceivedPath.Text);
tw.WriteElementString("ReceivedPath",this.extbRecivedPath.Text);
tw.WriteElementString("ErrorPath",this.extbErrorPath.Text);
tw.WriteElementString("NewPath",this.extbNewPath.Text);
tw.WriteElementString("LogFile",this.extbLogFile.Text); tw.WriteEndElement(); tw.WriteEndDocument(); tw.Flush();
tw.Close(); this.Close();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货