FileVersionInfo.ProductName Egenskap

Definition

Hämtar namnet på den produkt som filen distribueras med.

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

Egenskapsvärde

Namnet på den produkt som filen distribueras med eller null om filen inte innehåller versionsinformation.

Exempel

I följande exempel anropas GetVersionInfo för att hämta FileVersionInfo för Anteckningar. Sedan skrivs ProductName den ut i en textruta. Den här koden förutsätter textBox1 att den har instansierats.

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

Gäller för