FileVersionInfo.ProductName 属性    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与此文件一起发行的产品的名称。
public:
 property System::String ^ ProductName { System::String ^ get(); };public string? ProductName { get; }public string ProductName { get; }member this.ProductName : stringPublic ReadOnly Property ProductName As String属性值
与此文件一起发行的产品的名称,当文件不包含版本信息则为 null。
示例
以下示例调用 GetVersionInfo 以获取 FileVersionInfo 记事本的 。 然后,它会在文本框中打印 ProductName 。 此代码假定 textBox1 已实例化。
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