FileVersionInfo.ProductVersion Propriété

Définition

Obtient la version du produit avec lequel ce fichier est distribué.

public:
 property System::String ^ ProductVersion { System::String ^ get(); };
public string ProductVersion { get; }
member this.ProductVersion : string
Public ReadOnly Property ProductVersion As String

Valeur de propriété

La version du produit avec lequel ce fichier est distribué ou null si le fichier ne contenait pas d’informations de version.

Exemples

L’exemple d’appel GetVersionInfo suivant permet d’obtenir le FileVersionInfo Bloc-notes. Ensuite, il imprime le ProductVersion contenu dans une zone de texte. Ce code suppose qu’il textBox1 a été instancié.

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

    // Print the product version number.
    textBox1.Text = "Product version number: " + myFileVersionInfo.ProductVersion;
 }
Private Sub GetProductVersion()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
    
    ' Print the product version number.
    textBox1.Text = "Product version number: " & myFileVersionInfo.ProductVersion
End Sub

Remarques

En règle générale, un numéro de version est affiché sous la forme « numéro.major number.minor number.build number.private part number ». Un numéro de version de produit est un numéro 64 bits qui contient le numéro de version comme suit :

S’applique à

Voir aussi