FileVersionInfo.ProductName プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
このファイルを含む製品の名前を取得します。
public:
property System::String ^ ProductName { System::String ^ get(); };
public string? ProductName { get; }
public string ProductName { get; }
member this.ProductName : string
Public ReadOnly Property ProductName As String
プロパティ値
このファイルを含む製品の名前。ファイルにバージョン情報が含まれていない場合は null
。
例
次の例では、メモ帳のFileVersionInfo取得を呼び出GetVersionInfoします。 次に、テキスト ボックスに 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 = String::Concat( "Product name: ", myFileVersionInfo->ProductName );
}
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