Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

FileVersionInfo.ProductVersion Property

Gets the version of the product this file is distributed with.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

public string ProductVersion { get; }
/** @property */
public String get_ProductVersion ()

public function get ProductVersion () : String

Property Value

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 that holds the version number as follows:

The following example calls GetVersionInfo to get the FileVersionInfo for the Notepad. Then it prints the ProductVersion in a text box. This code assumes textBox1 has been instantiated.

private void GetProductVersion() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    // Print the product version number.
    textBox1.Text = "Product version number: " + myFileVersionInfo.ProductVersion;
 }
    

private void GetProductVersion()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = 
        FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");

    // Print the product version number.
    textBox1.set_Text("Product version number: " 
        + myFileVersionInfo.get_ProductVersion());
} //GetProductVersion

private function GetProductVersion() {
    //Get the file version for the notepad.
    var myFileVersionInfo : FileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    //Print the product version number.
    textBox1.Text = "Product version number: " + myFileVersionInfo.ProductVersion;
 }
    

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft