Application.ProductVersion プロパティ

定義

このアプリケーションに関連付けられている製品のバージョンを取得します。

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

プロパティ値

製品のバージョン。

次のコード例では、このプロパティを取得し、その値をテキスト ボックスに表示します。 この例では、 が textBox1 フォームに配置されている必要があります。

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

注釈

通常、バージョン番号は メジャー番号として表示されます。マイナー番号ビルド番号プライベート部品番号。 アセンブリ マニフェスト内でアセンブリ のバージョンを設定することで、明示的に設定できます。 詳細については、「 アセンブリ マニフェスト」を参照してください。

ProductVersion最初にメインの実行可能ファイルを含むアセンブリに AssemblyInformationalVersion 属性が含まれているかどうかを調べます。 この属性が存在する場合は、 と CommonAppDataPathの両方ProductVersionに使用されます。 この属性が存在しない場合、両方のプロパティで、実行可能ファイルのバージョンが代わりに使用されます。

適用対象

こちらもご覧ください