当前位置:网站首页>C get the version number of exe - file version and assembly version

C get the version number of exe - file version and assembly version

2022-06-25 07:44:00 ※※ Bingxin ※※

adopt System.Diagnostics.FileVersionInfo.GetVersionInfo Get the file version , The corresponding [assembly: AssemblyFileVersion("")], instead of [assembly: AssemblyVersion("")]. Right click the file attribute to see the file version ( Or product version ).

What you get from the following code is assembly edition [assembly: AssemblyVersion("1.0.0.0")], as follows :

 var softwareVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

If you want to get the file version of the current program , The code is :

  System.Windows.Forms.Application.ProductVersion.ToString();

原网站

版权声明
本文为[※※ Bingxin ※※]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206250541235734.html