有没有办法检查文件的版本?

new*_*guy 5 c# version

有没有办法检查文件的版本?我正在使用 Windows 窗体应用程序。

Eri*_* J. 5

您可以使用系统诊断。文件版本信息.GetVersionInfo(字符串)

文件版本信息

提供磁盘上物理文件的版本信息。

获取版本信息()

返回表示与指定文件关联的版本信息的 FileVersionInfo。

var version = FileVersionInfo.GetVersionInfo(path).FileVersion;
Run Code Online (Sandbox Code Playgroud)