FileVersionInfo.ProductName プロパティ

定義

このファイルが配布される製品の名前を取得します。

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

プロパティ値

ファイルにバージョン情報が含まれていない場合は、このファイルが配布される製品の名前または null

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

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

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

適用対象