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