Control.ProductName Property
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 product name of the assembly containing the control.
public:
property System::String ^ ProductName { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public string ProductName { get; }
[<System.ComponentModel.Browsable(false)>]
member this.ProductName : string
Public ReadOnly Property ProductName As String
The product name of the assembly containing the control.
- Attributes
The following code example displays information about the application in a Label contained by a Form. This example requires that the CompanyName, ProductName and ProductVersion have been set.
void AboutDialog_Load( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Display the application information in the label.
this->labelVersionInfo->Text = String::Format( "{0} {1} Version: {2}", this->CompanyName, this->ProductName, this->ProductVersion );
}
private void AboutDialog_Load(object sender, EventArgs e)
{
// Display the application information in the label.
this.labelVersionInfo.Text =
this.CompanyName + " " +
this.ProductName + " Version: " +
this.ProductVersion;
}
Private Sub AboutDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Display the application information in the label.
Me.labelVersionInfo.Text = _
Me.CompanyName + " " + _
Me.ProductName + " Version: " + _
Me.ProductVersion
End Sub
The ProductName property is a read-only property. To change the value of this property, set the Product property value of the AssemblyProductAttribute. The following line of C# code sets the ProductName property.
[assembly: AssemblyProduct("MyApplication")]
참고
It is strongly recommended that you provide the company name, product name, and product version. Providing this information enables the use of Windows Forms features such as Application.UserAppDataPath that make it easier to write applications that comply with the "Certified for Windows" program.
제품 | 버전 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.