FileVersionInfo.ProductMajorPart プロパティ

定義

このファイルが関連付けられている製品のバージョン番号の主要部分を取得します。

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

プロパティ値

製品バージョン番号の主要部分を表す値。ファイルにバージョン情報が含まれていない場合は null

次の例では、 GetVersionInfo を呼び出してメモ帳の FileVersionInfo を取得します。 次に、テキスト ボックスに ProductMajorPart を出力します。 このコードでは、 textBox1 がインスタンス化されていることを前提としています。

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

注釈

通常、バージョン番号は "major number.minor number.build number.private part number" として表示されます。 製品バージョン番号は、次のようにバージョン番号を保持する 64 ビット番号です。

このプロパティは、16 ビットの最初のセットを取得します。

適用対象

こちらもご覧ください