FileVersionInfo.ProductName Właściwość

Definicja

Pobiera nazwę produktu, z tym plikiem jest dystrybuowany.

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

Wartość właściwości

Nazwa produktu, z tym plikiem jest dystrybuowana lub null jeśli plik nie zawiera informacji o wersji.

Przykłady

Poniższe przykładowe wywołania GetVersionInfo , aby pobrać FileVersionInfo element dla Notatnika. Następnie drukuje element ProductName w polu tekstowym. Ten kod zakłada, że textBox1 wystąpienie zostało utworzone.

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

Dotyczy