FileVersionInfo.ProductMajorPart Propriété

Définition

Obtient la partie principale du numéro de version du produit auquel ce fichier est associé.

public:
 property int ProductMajorPart { int get(); };
public int ProductMajorPart { get; }
member this.ProductMajorPart : int
Public ReadOnly Property ProductMajorPart As Integer

Valeur de propriété

Valeur représentant la partie principale du numéro de version du produit null si le fichier ne contenait pas d'informations de version.

Exemples

L’exemple suivant appelle GetVersionInfo pour obtenir le FileVersionInfo pour le Bloc-notes. Ensuite, il imprime le ProductMajorPart dans une zone de texte. Ce code suppose qu’il textBox1 a été instancié.

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

        // Print the product major part number.
        textBox1->Text = String::Concat( "Product major part number: ", myFileVersionInfo->ProductMajorPart );
    }
private void GetProductMajorPart()
{
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo =
        FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\Notepad.exe");

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

Remarques

En règle générale, un numéro de version s’affiche sous la forme « numéro principal.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 :

Cette propriété obtient le premier ensemble de 16 bits.

S’applique à

Voir aussi