FileVersionInfo.ProductName Propriété

Définition

Obtient le nom du produit avec lequel ce fichier est distribué.

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

Valeur de propriété

Le nom du produit avec lequel ce fichier est distribué ou null si le fichier ne contenait pas d’informations de version.

Exemples

L’exemple d’appel GetVersionInfo suivant permet d’obtenir le FileVersionInfo Bloc-notes. Ensuite, il imprime le ProductName contenu dans une zone de texte. Ce code suppose qu’il textBox1 a été instancié.

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

S’applique à