FileVersionInfo.ProductVersion プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
このファイルが配布される製品のバージョンを取得します。
public:
property System::String ^ ProductVersion { System::String ^ get(); };
public string ProductVersion { get; }
member this.ProductVersion : string
Public ReadOnly Property ProductVersion As String
プロパティ値
ファイルにバージョン情報が含まれていない場合、このファイルが配布される製品のバージョンまたは null 。
例
次の例では、 GetVersionInfo を呼び出してメモ帳の FileVersionInfo を取得します。 次に、テキスト ボックスに ProductVersion を出力します。 このコードでは、 textBox1 がインスタンス化されていることを前提としています。
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
注釈
通常、バージョン番号は "major number.minor number.build number.private part number" として表示されます。 製品バージョン番号は、次のようにバージョン番号を保持する 64 ビット番号です。
最初の 16 ビットは ProductMajorPart 番号です。
次の 16 ビットは ProductMinorPart 番号です。
16 ビットの 3 番目のセットは、 ProductBuildPart 番号です。
最後の 16 ビットは ProductPrivatePart 番号です。