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 属性があるかどうかを確認します。 この属性が存在する場合は、 ProductVersionCommonAppDataPathの両方に使用されます。 この属性が存在しない場合、両方のプロパティで代わりに実行可能ファイルのバージョンが使用されます。

適用対象

こちらもご覧ください