Is there a way to check the version of a file? I am using windows form application.
You can use System.Diagnostics.FileVersionInfo.GetVersionInfo(String)
FileVersionInfo
Provides version information for a physical file on disk.
GetVersionInfo()
Returns a FileVersionInfo representing the version information associated with the specified file.
var version = FileVersionInfo.GetVersionInfo(path).FileVersion;
Use this:
var filePath = @"C:\Windows\System32\xwizard.exe";
var fileInfo = FileVersionInfo.GetVersionInfo(filePath);
var vers = fileInfo.FileVersion;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With