注:从XML到C#读取行 [英] Reg:Reading rows from XML to C#

查看:58
本文介绍了注:从XML到C#读取行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我在读取XML到C的值时遇到问题#



这是我想要检索每一行的xml文件。

Dear Friends,

I Have a problem while reading the values from XML to C#

Here is my xml file i want to retrieve each row.

<rows>
  <row id="r1" number="1" c1="715763" c2="PAID" c3="2013-09-13" c4="Followup" />
  <row id="r2" number="2" c1="719679" c2="PAID" c3="2013-09-01" c4="Followup" />
  <row id="r3" number="3" c1="749760" c2="PAID" c3="2013-09-05" c4="Followup" />
</rows>









你能帮我吗?





谢谢和问候

Rushi





can u any one help me?


Thanks and Regards
Rushi

推荐答案

有不同的方法可以从.NET FCL轻松获得XML解析。这是我对他们的简短概述:



There are different methods of XML parsing readily available from .NET FCL. This is my short overview of them:

  1. 使用 System.Xml.XmlDocument class 。它实现了DOM接口;如果文档的大小不是太大,这种方式是最简单和最好的。
    参见 http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx [ ^ ]。
  2. 使用类 System.Xml.XmlTextReader ;这是最快的阅读方式,特别是你需要跳过一些数据。
    参见 http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx [ ^ ]。
  3. 使用类 System.Xml.Linq.XDocument ;这是类似于 XmlDocument 的最合适的方式,支持LINQ to XML Programming。
    参见 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 class 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.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[^].





祝你好运,

-SA


检查这些并学习如何从xml中提取信息文件:

使用以下方式处理XML数据XPath和XmlDocument(C#) [ ^ ]

C#:从XML文件中提取XML数据的两种方法(System.XML) .Linq,System.IO) [ ^ ]

使用C#从XML文件读取数据 [ ^ ]

快速阅读xml [ ^ ]
Check these and learn how to extract information from xml file:
Manipulate XML data with XPath and XmlDocument (C#)[^]
C#: Two ways to extract XML data from an XML file (System.XML.Linq, System.IO)[^]
Reading Data from XML File Using C#[^]
Reading xml fast [^]


使用xmldocument c#读取xml [ ^ ]



我的这个链接会帮助你,如果你能得到plz指定你的条件我会帮助你
Reading an xml using xmldocument c#[^]

my be this link will help u if you can get plz specify your condition i will help u


这篇关于注:从XML到C#读取行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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