FileVersionInfo.FileVersion Property

Gets the file version number.

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

public string FileVersion { get; }
/** @property */
public String get_FileVersion ()

public function get FileVersion () : String

Property Value

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

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

public void GetFileVersion() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    // Print the file name and version number.
    textBox1.Text = "File: " + myFileVersionInfo.FileDescription + '\n' +
       "Version number: " + myFileVersionInfo.FileVersion;
 }
    

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: