且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

汇编版本从命令行?

更新时间:2023-02-22 09:34:51

这是PowerShell发光的区域。如果你还没有它,请安装它。预装了Windows 7。

This is an area where PowerShell shines. If you don't already have it, install it. It's preinstalled with Windows 7.

运行此命令行:

[System.Reflection.Assembly]::LoadFrom("YourDllName.dll").GetName().Version

输出:

Major  Minor  Build  Revision
-----  -----  -----  --------
3      0      8      0

请注意LoadFrom返回一个程序集对象,所以你可以做任何你喜欢的任何事情。不需要编写程序。

Note that LoadFrom returnes an assembly object, so you can do pretty much anything you like. No need to write a program.