FileVersionInfo.ProductName Eigenschap

Definitie

Hiermee haalt u de naam op van het product waarmee dit bestand wordt gedistribueerd.

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

Waarde van eigenschap

De naam van het product waarmee dit bestand wordt gedistribueerd of null als het bestand geen versie-informatie bevat.

Voorbeelden

In het volgende voorbeeld wordt aanroepen GetVersionInfo om het FileVersionInfo voor Kladblok op te halen. Vervolgens wordt het ProductName in een tekstvak afgedrukt. Bij deze code wordt ervan uitgegaan dat textBox1 deze is geïnstantieerd.

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

Van toepassing op