如何从清单文件读取版本 [英] How to read version from manifest file
本文介绍了如何从清单文件读取版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,我正在开发C#.net Windows应用程序
我在以下文件"ChequeMaster.exe.manifest"中找到了版本号..
这是xml文件,我想单独从其中读取版本
有人可以帮我吗?
感谢
Hi friends i am developing C# .net windows Application
i found the version number in the following file "ChequeMaster.exe.manifest" ..
this is xml file i want to read the version alone from this
any one could you help me ?
thanks
推荐答案
您只需将Xml加载到 ^ ]使用其加载之一> [^ ]方法(或 LoadXml [ SelectSingleNode [
You would just load up the Xml into an XmlDocument[^] using one of its Load[^] methods (or LoadXml[^] if you prefer). And then just use XPath via the SelectSingleNode[^] to obtain the string for the Version information.
Though, you can just also use the following to read the version information off of a .NET assembly:
System.Version objVersion = System.Reflection.Assembly.LoadFile(FilePath).GetName().Version;
这篇关于如何从清单文件读取版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文