在C#什么是解析大型XML(1GB大小)的最佳方式......? [英] In C# What is the best way to parse Large XML (Size of 1GB)...?

查看:230
本文介绍了在C#什么是解析大型XML(1GB大小)的最佳方式......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个1GB的XML文件和要分析它。如果我使用XML的TextReader或为XMLDocument,结果很慢,有时挂...您的答案,欢迎

I am having a 1GB XML File and want to parse it.If i use XML Textreader or XMLDocument ,result is very slow and some times hangs ...Your answers are welcome

推荐答案

您必须使用的XMLReader实现自定义逻辑。 XMLReader不能完整的XML加载到内存中使用它,这意味着你可以从流中读取并处理它是这样了。

You'll have to implement custom logic using xmlreader. xmlreader does not load the full XML into memory before using it, which means you can read it from a stream and process it as such.

这篇关于在C#什么是解析大型XML(1GB大小)的最佳方式......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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