我怎样才能获得汇编文件版本版本、文件

由网友(南风吹北巷)分享简介:在程序集信息有两个组件的版本:的AssemblyVersion :指定程序集的版本归咎于AssemblyFileVersion :指示编译器使用特定的版本号为Win32文件版本资源。在Win32文件版本不要求是相同的组件的版本号。AssemblyVersion: Specify the version of the a...

程序集信息有两个组件的版本:

的AssemblyVersion :指定程序集的版本归咎于 AssemblyFileVersion :指示编译器使用特定的版本号为Win32文件版本资源。在Win32文件版本不要求是相同的组件的版本号。 AssemblyVersion: Specify the version of the assembly being attributed. AssemblyFileVersion: Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number.

我可以获得组装版与code以下行:

I can get the Assembly Version with the following line of code:

Version version = Assembly.GetEntryAssembly().GetName().Version;

但我怎么能获得大会文件版本

推荐答案

请参阅我的上述评论要求澄清你真正想要的。但愿这是它:

See my comment above asking for clarification on what you really want. Hopefully this is it:

System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
阅读全文

相关推荐

最新文章