如何比较同一DLL文件的2个版本。 [英] How do I compare 2 versions of the same DLL file.

查看:137
本文介绍了如何比较同一DLL文件的2个版本。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,有人可以告诉我是否可以比较版本2的dll文件是否相同但是较新的版本有更改的课程,如果有可能用旧版本替换旧的版本如果旧版本已经更新在您的代码中引用。如果有可能,有人可以给我一个提示从哪里开始。



我尝试过:



我试过在线搜索。我发现我的文章很少,但没有一篇文章特定于我的问题。

Hi guys could someone tell me if it is possible to compare the version 2 dll files that are the same but the newer version has changes ofcourse and if its possible to replace the old one with the newer one if the old one has been referenced in your code. If its possible can someone give me a hint where to start pls.

What I have tried:

ive tried searching online. I've found i few articles but none of them are specific to my problem.

推荐答案

您可以使用System.Reflection库来获取任何信息。部件。您正在寻找的属性是AssemblyName类的Version属性。



有关详细信息,请查看这个 MSDN文章。



有美好的一天。
You can make use of the System.Reflection library to get the information about any assembly. The property you're looking for is Version property of the AssemblyName class.

For more details check out this MSDN article.

Have a good day.


如果你所追求的是有关文件版本的信息;使用 FileVersionInfo [ ^ ]课程。它完全符合顾名思义。例如,如果你想要文件版本,你可以这样做:
If all you are after is information about the file version; use the FileVersionInfo[^] class. It does exactly what the name suggests. For instance, if you want the file version, you would do this:
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(filePath);
string productVersion = versionInfo.FileVersion;


请看一下
我认为这符合您的要求。

使用哈希以编程方式比较两个DLL文件 [ ^ ]


这篇关于如何比较同一DLL文件的2个版本。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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