FileVersionInfo.ProductName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the product this file is distributed with.
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
Property Value
The name of the product this file is distributed with or null
if the file did not contain version information.
Examples
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.
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
Applies to
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.