在C#中的一个文本文件中读取或查找两个xml文件路径 [英] Two xml file path read or find in a one text file in C#
问题描述
大家好,
我想要两个xml文件路径[.... \ abc.xm l和... .\ xyz.xml ]从一个文本文件[ filepath.txt
]中读取并比较两个xml文件的数据,两个文件数据值不匹配比这个结果显示在一个文本文件的excel文件中。
I want to two xml file path [....\abc.xml and ....\xyz.xml ] read from in a one text file [ filepath.txt ] and compare data of both xml file , both file data value mismatch than this result show in excel file file from a one text file.
推荐答案
您好,
这是您的问题的错误论坛,因为它与WPF无关。
This is the wrong forum for your question because it's got nothing to do with WPF.
如果你想阅读txt文件,你可以参考以下文章。
If you want read the txt file ,you can refer the following article.
所以你可以这样做:
string[] lines = System.IO.File.ReadAllLines(@"filepath.txt");
如果要读取和解析xml文件,可以在System.Xml命名空间中使用XmlDocument类。
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(lines[0]);
您还可以使用System.Xml.Linq命名空间中的XDocument类。
https://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument(v = vs.110).aspx
XDocument xDocument = XDocument.Load(lines[1]);
此致,
Bob
Bob
这篇关于在C#中的一个文本文件中读取或查找两个xml文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!