Environment

During its lifetime, an application runs in a certain environment. The environment is provided by a combination of compile-time and run-time settings supplied by .NET and Windows.

Compile-Time Settings

The Application class exposes several properties that provide the company name, product name, and product version of the currently running application:

void AboutBox_Load(object sender, EventArgs e) {
  this.companyNameTextBox.Text = Application.CompanyName;
  this.productNameTextBox.Text = Application.ProductName;
  this.productVersionTextBox.Text = Application.ProductVersion;
}

By default, these three values come from assemblywide AssemblyCompanyAttribute, AssemblyProductAttribute, and AssemblyVersionAttribute (provided in a wizard-generated ...

Get Windows Forms Programming in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.