C# 连接到提供 xml 文档的 URL
我如何在 C# 中调用一个给我一个 xml 文件的 URL,然后处理该 xml 文件,例如进行解析。
How can I in C# call a URL which gives me a xml file, and then process that xml file for example for parsing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要将 XML 文件下载到您的硬盘上,您只需执行以下操作即可。
如何解析它是另一回事,有几种不同的方法可以做到这一点。这是一个问题涵盖了主题。您还可以查看 MSDN 上的 LINQ to XML 参考。
To download an XML file onto your hard disk you can simply do.
How you parse it is a different matter and there are several different ways to do it. Here is a SO question that covers the subject. You can also checkout the LINQ to XML reference on MSDN.
来自:http://zamov.online.fr/EXHTML/CSharp/CSharp1.html
XML 解析器:
http://www .c-sharpcorner.com/uploadfile/shehperu/simplexmlparser11292005004801am/simplexmlparser.aspx
只需将流传递到 XML 解析器即可。
from : http://zamov.online.fr/EXHTML/CSharp/CSharp1.html
XML Parser:
http://www.c-sharpcorner.com/uploadfile/shehperu/simplexmlparser11292005004801am/simplexmlparser.aspx
Just pass the stream to the XML Parser.