繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> XML应用 >> 将XML信息存入文件

将XML信息存入文件

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:13  文字大小:【】【】【
简介:(其实可以使用XMLDocuemnt里面自己带的方法,我还是喜欢我这种方式)。 try             {         &n...
关键字:文件 信息 XML

(其实可以使用XMLDocuemnt里面自己带的方法,我还是喜欢我这种方式)。

try

{

string xmlFileContent="\n\r";

xmlFileContent+="\n\r";

xmlFileContent+="\n\r";

。。。。。

xmlFileContent+="\n\r";

file=System.IO.File.CreateText("c:\\media.xml");

System.IO.StreamWriter file=new System.IO.StreamWriter(this.WorkPath(5)+"\\media.xml",false,System.Text.Encoding.Default);

file.Write(xmlFileContent);

file.Close();

}

catch(System.Xml.XmlException e)

{

MessageBox.Show("测试版运行中错误,请将以下详细错误信息发送到XXXX@XXX.COM,协助我们进一步修正,谢谢:"+e.Message,"系统错误",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Error);

}

责任编辑:admin
相关文章