Share via


FileVersionInfo.ProductMajorPart Eigenschaft

Definition

Ruft den Hauptteil der Versionsnummer des Produkts ab, dem diese Datei zugeordnet ist.

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

Eigenschaftswert

Ein Wert, der den Hauptteil der Produktversionsnummer darstellt, oder null, wenn die Datei keine Versionsinformationen enthielt.

Beispiele

Im folgenden Beispiel wird aufgerufen GetVersionInfo , um die FileVersionInfo für den Editor abzurufen. Anschließend wird die ProductMajorPart in einem Textfeld ausgegeben. Dieser Code setzt voraus, dass textBox1 sie instanziiert wurde.

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

Hinweise

In der Regel wird eine Versionsnummer als "major number.minor number.build number.private part number" angezeigt. Eine Produktversionsnummer ist eine 64-Bit-Nummer, die die Versionsnummer wie folgt enthält:

Diese Eigenschaft ruft den ersten Satz von 16 Bits ab.

Gilt für:

Weitere Informationen