Accessing File Version

  • Thread starter Thread starter Angela Spranger
  • Start date Start date
A

Angela Spranger

I need to access the version of a file from within my C#
app. Does anyone know how to do this?
 
You should be able to use the FileVersionInfo clas

[C#]
public void GetFileVersion()
// Get the file version for the notepad
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("C:\\WINNT\\Notepad.exe")

// Print the file name and version number
textBox1.Text = "File: " + myFileVersionInfo.FileDescription + '\n'
"Version number: " + myFileVersionInfo.FileVersion
 
thank you

I had found a way to do it but this way was easier.


-----Original Message-----
You should be able to use the FileVersionInfo class


[C#]
public void GetFileVersion() {
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("C:\\WINNT\\Notepad.exe");

// Print the file name and version number.
textBox1.Text = "File: " +
myFileVersionInfo.FileDescription + '\n' +
 
Back
Top