FileVersionInfo.ProductName Vlastnost

Definice

Získá název produktu, se kterým je tento soubor distribuován.

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

Hodnota vlastnosti

Název produktu, se kterým je tento soubor distribuován, nebo null pokud soubor neobsahuje informace o verzi.

Příklady

Následující příklad volá GetVersionInfo , aby získal pro FileVersionInfo Poznámkový blok. Potom se vytiskne do ProductName textového pole. Tento kód předpokládá, že textBox1 došlo k vytvoření instance.

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

Platí pro