C# 获取程序版本号

第一种:通过System来获取;

public static Version GetEdition()
{
    return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
}

第二种:通过Application来获取;

public static string GetEdition()
{
    return Application.ResourceAssembly.GetName().Version.ToString();
}

猜你喜欢

转载自blog.csdn.net/BYH371256/article/details/120430517