如何使用c#从特定文件夹中读取一堆xml [英] how can read bunch of xml from particular folder using c#

查看:119
本文介绍了如何使用c#从特定文件夹中读取一堆xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,

I have to read XML files from particular folder using c#.

Let me know the best way to read XML files from the folder.

Thanks in Advance.

推荐答案

用很少的信息就不可能回答您的问题.
例如,您将如何处理数据.
文件具有相同的结构还是不同?
如果它们都相同,那么您是否有一个架构文件?

一般而言,您可以使用数据集 [ ^ ]类和方法 DataSet.ReadXml [ ^ ]
或者您可以使用XmlDocument或XDocument.
哪一个对你最好呢?

要遍历文件夹中的文件,可以使用 Directory.GetFiles [ ^ ].
It impossible to answer your question with so little information.
What are you going to do with the data, for example.
Do the files have the same structure or are the they different?
If they are all the same, do you have a schema file?

In general terms you can use the DataSet[^] class and the method DataSet.ReadXml[^]
or you can use XmlDocument or XDocument.
Which is best for you is impossible to say.

To loop through the files in a folder you can use Directory.GetFiles[^].


这篇关于如何使用c#从特定文件夹中读取一堆xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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