LoginSignup
0
0

More than 5 years have passed since last update.

WPF > 発行バージョンを取得

Last updated at Posted at 2019-04-11

System.Deploymentを参照して、

image

以下

using System;
using System.Deployment.Application;


/// <summary>
/// バージョン番号取得。ClickOnceで実行した時だけ取得される
/// </summary>
/// <returns></returns>
public static string GetClickOnceVersion()
{
    if (!ApplicationDeployment.IsNetworkDeployed) return String.Empty;

    var version = ApplicationDeployment.CurrentDeployment.CurrentVersion;
    return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0