使用模式创建xml文件 [英] Create xml file with schema
本文介绍了使用模式创建xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我正在使用.net 2008创建Windows应用程序,我有2个文本框和一个按钮的表单,我想在文本中保存文本单击按钮时,框到xml文件..
I'm using .net 2008 to create windows application, I have form with 2 text boxes and a button, i want to save the text in text boxes to xml file when click the button..
< serverID>
< Description> textBox1.text< / Description>
< IP> textBox2.text< / IP>
< / serverID>
<serverID>
<Description>textBox1.text</Description>
<IP>textBox2.text</IP>
</serverID>
如果xml文件已经存在,我管理完所有上述操作,我的问题我不知道如何用这些节点创建xml文件并保存每个textBox的文本??
I managed doing all of the above if the xml file already exists, my problem i dont know how to create xml file with these nodes and save the text of each textBox in it??
推荐答案
查找XML序列化。 .Net可以自动为您自动序列化/反序列化XML。
Look up XML Serialization. .Net can automatically serialize/deserialize the XML for you.
这篇关于使用模式创建xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文