FileVersionInfo.ProductVersion プロパティ

定義

このファイルを含む製品のバージョンを取得します。

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

プロパティ値

String

このファイルを含む製品のバージョン。ファイルにバージョン情報が含まれていない場合は null

次の例では、メモ帳のFileVersionInfo取得を呼び出GetVersionInfoします。 次に、テキスト ボックスに 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 = String::Concat( "Product version number: ", myFileVersionInfo->ProductVersion );
    }
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 ビット番号です。

適用対象

こちらもご覧ください