Export (0) Print
Expand All

FileVersionInfo.ProductName Property

Gets the name of the product this file is distributed with.

[Visual Basic]
Public ReadOnly Property ProductName As String
[C#]
public string ProductName {get;}
[C++]
public: __property String* get_ProductName();
[JScript]
public function get ProductName() : String;

Property Value

The name of the product this file is distributed with.

Example

The following example calls GetVersionInfo to get the FileVersionInfo for the Notepad. Then it prints the ProductName in a text box. This code assumes textBox1 has been instantiated.

[Visual Basic] 
Private Sub GetProductName()
    ' Get the file version for the notepad.
    Dim myFileVersionInfo As FileVersionInfo = _
        FileVersionInfo.GetVersionInfo("%systemroot%\Notepad.exe")
    
    ' Print the product name.
    textBox1.Text = "Product name: " & myFileVersionInfo.ProductName
End Sub 'GetProductName

[C#] 
private void GetProductName() {
    // Get the file version for the notepad.
    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    // Print the product name.
    textBox1.Text = "Product name: " + myFileVersionInfo.ProductName;
 }
    

[C++] 
private:
void GetProductName() {
    // Get the file version for the notepad.
    FileVersionInfo* myFileVersionInfo = FileVersionInfo::GetVersionInfo(S"%systemroot%\\Notepad.exe");
 
    // Print the product name.
    textBox1->Text = String::Format( S"Product name: {0}", myFileVersionInfo->ProductName );
 }
    

[JScript] 
private function GetProductName() {
    //Get the file version for the notepad.
    var myFileVersionInfo : FileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
 
    //Print the product name.
    textBox1.Text = "Product name: " + myFileVersionInfo.ProductName;
 }
    

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

FileVersionInfo Class | FileVersionInfo Members | System.Diagnostics Namespace

Show:
© 2014 Microsoft