Gets the file version number.
[Visual Basic] Public ReadOnly Property FileVersion As String [C#] public string FileVersion {get;} [C++] public: __property String* get_FileVersion(); [JScript] public function get FileVersion() : String;
The version number of the file.
Typically, a version number is displayed as "major number.minor number.build number.private part number". A file version number is a 64-bit number which holds the version number for a file as follows:
The following example calls GetVersionInfo to get a FileVersionInfo for the Notepad. Then it prints the file description and version number in a text box. This code assumes TextBox1 has been instantiated.
[Visual Basic]
Private Sub GetFileVersion() 'Get the file version for the Notepad. Dim myFileVersionInfo As System.Winforms.FileVersionInfo myFileVersionInfo = System.Winforms.FileVersionInfo.GetVersionInfo("c:\WINNT\Notepad.exe") 'Print the file name and version number. TextBox1.Text = "File: " & myFileVersionInfo.FileDescription & crlf TextBox1.Text &= "Version Number: " & myFileVersionInfo.FileVersion End Sub
FileVersionInfo Class | FileVersionInfo Members | System.WinForms Namespace | FileBuildPart | FileMinorPart | FileMajorPart | System.WinForms.Version | FilePrivatePart