如何以Windows格式保存XML格式的数据? [英] How to save the data written in Windows form in XML format ?

查看:73
本文介绍了如何以Windows格式保存XML格式的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在解决方案中添加了一个Windows窗体,并在其中添加了3个这样的标签和文本框.

姓名:-
说明:-
位置:-浏览



OK
取消



在此表单中,名称,描述和位置前面有3个文本框,而浏览"是我要以XML格式保存文件的位置. 确定"和取消"是按钮.

我的XML格式将如下所示:-



I have added one Windows Form in my solution and in that I have added 3 labels and Textboxes like this.

Name :-
Description:-
Location:- Browse



OK
Cancel



In this form in front of Name, Description and Location there are 3 textboxes and Browse is the location whre I want to save my file in XML format. OK and Cancel are the buttons.

My XML format will be like this:-

<projects>
   <project>
      <name>ABC</name>
      <id>2<id>
      <description></description>
      <location></location>
      <createdby></createdby>
       <createddate></createddate>
   </id></id></project>
</projects>



请注意,xml的名称应与Windows窗体的文本框中提供的名称相同.
例如,如果名称是ABC,则名称必须是ABC.XML

我正在使用C#.net技术

请帮忙.

在Advance中致谢



Note that Name of xml should be the same name given in textbox in the windows form.
and if for example the name is ABC so name must be ABC.XML

I am using C#.net technology

Please help.

Thanks in Advance

推荐答案

查看以下链接以创建xml文件:

http://www.devx.com/tips/Tip/21168 [ http://www.c-sharpcorner.com/uploadfile/mahesh/readwritexmltutmellli2111282005041517am/readwritexmlxutmellli21. /a> [ ^ ]

http://www.dotnetspider.com/resources/427-Create-XML-file-using-C-NET-wi-indentation.aspx [
Check out these links to create an xml file :

http://www.devx.com/tips/Tip/21168[^]

http://www.c-sharpcorner.com/uploadfile/mahesh/readwritexmltutmellli2111282005041517am/readwritexmltutmellli21.aspx[^]

http://www.dotnetspider.com/resources/427-Create-XML-file-using-C-NET-wi-indentation.aspx[^]


我需要类似的内容,当我单击确定"按钮时,我在3个文本框中的数据以XML格式保存.这些链接给我的感觉不一样.

你能给我这样的东西吗? ??
I need something like When I click on OK Button, My data in 3 textboxes are saved in the XML format. these links do not give me the same.

Can you provide me somethins like that. ??


这篇关于如何以Windows格式保存XML格式的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆