Application.ProductName 屬性

定義

取得與這個應用程式關聯的產品名稱。

public:
 static property System::String ^ ProductName { System::String ^ get(); };
public static string ProductName { get; }
member this.ProductName : string
Public Shared ReadOnly Property ProductName As String

屬性值

String

產品名稱。

範例

下列程式碼範例會取得這個屬性,並在文字方塊中顯示其值。 此範例要求 textBox1 已放在表單上。

private:
   void PrintProductName()
   {
      textBox1->Text = "The product name is: {0}",
         Application::ProductName;
   }
private void PrintProductName() {
    textBox1.Text = "The product name is: " +
       Application.ProductName;
 }
Private Sub PrintProductName()
   textBox1.Text = "The product name is: " & _
      Application.ProductName
End Sub

備註

ProductName 取自包含目前應用程式主要形式之元件的中繼資料。 您可以在元件資訊清單內設定 AssemblyProductAttribute 來設定它。 如需詳細資訊,請參閱 組件資訊清單

適用於

另請參閱