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é

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

Exemples

L’exemple suivant appelle GetVersionInfo pour obtenir le FileVersionInfo pour le Bloc-notes. Ensuite, il imprime le ProductName 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 = 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

S’applique à