var versionInfo = FileVersionInfo.GetVersionInfo(filePath);spa
String productVersion = versionInfo.ProductVersion;
String fileVersion = versionInfo.FileVersion;orm
其中產品
productionVersion/fileVersion爲右鍵屬性中的產品版本號及文件版本號。io
在程序集屬性中二者分別對應:form
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyInformationalVersion("1.0.1.1")]file
而程序集中常見的[assembly: AssemblyVersion("1.0.0.0")]屬性則是程序集版本號,該號與要調用該程序集的程序集有關。程序