在asp.net中读取和写入xml文件 [英] read and write xml files in asp.net
本文介绍了在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:
- 使用
System.Xml.XmlDocument
类.它实现了DOM接口;如果文档太大,则这种方法最简单,也足够好.
请参见 ^ ]. - 使用类
System.Xml.XmlTextWriter
和System.Xml.XmlTextReader
;这是最快的读取方法,尤其是您需要跳过一些数据.
请参见 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 [
- 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[^]. - Use the classes
System.Xml.XmlTextWriter
andSystem.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[^]. - Use the class
System.Xml.Linq.XDocument
; this is the most adequate way similar to that ofXmlDocument
, 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
Use whatever is more suitable for your task.
The rest of it is described here: Microsoft Q209354
可能对您有帮助:
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屋!
查看全文