在asp.net中读取和写入xml文件 [英] read and write xml files in asp.net

查看:90
本文介绍了在asp.net中读取和写入xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...全部

首先,如何编写xml文件,并将该文件保存在所需的文件夹中
exp:G:\ lokesh \ asp.net \ sample1.xml

如何读取xml文件并在列表框中显示

请用清晰的示例重播我...

ant 任何帮助

Hi......to all

first of all how to write the xml file,and that file is saved in required folder
exp:G:\lokesh\asp.net\sample1.xml
and
how to read the xml file and displayed in list box

replay me with clear example please...

please ant any one help to me

推荐答案

这是我对.NET中可用类的简短概述:

This is my short overview of the classes available in .NET:

  1. 使用System.Xml.XmlDocument类.它实现了DOM接口;如果文档太大,则这种方法最简单,也足够好.
    请参见 http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx [ http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx [ http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx [http://msdn.microsoft.com/en-us/library/bb387063.aspx [
  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^].
  2. Use the classes System.Xml.XmlTextWriter and System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx[^], http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^].
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].



使用更适合您任务的内容.

其余内容在此处进行了描述:
Microsoft Q209354

—SA



Use whatever is more suitable for your task.

The rest of it is described here: Microsoft Q209354

—SA


可能对您有帮助:
http://www.dotnetspider.com/resources/2970-XML-READ-WRITE- ASP.aspx [ ^ ]

http://www.freevbcode.com/ShowCode.asp?ID=2789 [ ^ ]

希望对您有所帮助.
May be this helps to you:
http://www.dotnetspider.com/resources/2970-XML-READ-WRITE-ASP.aspx[^]

http://www.freevbcode.com/ShowCode.asp?ID=2789[^]

Hope it helps.


这篇关于在asp.net中读取和写入xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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