zoukankan      html  css  js  c++  java
  • ClickOnce 获取客户端发布版本号

    做项目时使用智能客户端开发,在客户端需要获取发布的版本号,记录下来,以备查看。   

         /// <summary>
            /// 获取客户端发布版本号
            /// </summary>
            /// <returns>当前版本号</returns>
            private static string GetVersiion()
            {
                var version = "";
                if(ApplicationDeployment.IsNetworkDeployed)//是否已连接
                {
                    ApplicationDeployment currDeployment = ApplicationDeployment.CurrentDeployment;
                    DateTime lastCheck = currDeployment.TimeOfLastUpdateCheck.ToLocalTime();
                    var lastDay = lastCheck.Date.ToShortDateString();
                    var lastTime = lastCheck.TimeOfDay.ToString();
                    var majorVersion = currDeployment.CurrentVersion.Major.ToString();//主版本
                    var minorVersion = currDeployment.CurrentVersion.Minor.ToString(); //次版本
                    var revisionVersion = currDeployment.CurrentVersion.Revision.ToString();//内部版本号
                    var blildVersion = currDeployment.CurrentVersion.Build.ToString();//修订号

                    version = majorVersion + "." + minorVersion + "." + blildVersion + "." + revisionVersion;
                }
                return version;
            }

    作者:chhuic

    出处:http://chhuic.cnblogs.com
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

  • 相关阅读:
    1、scala安装和基本语法
    3.12-3.16 Hbase集成hive、sqoop、hue
    3.7-3.9 HBase表属性
    3.4-3.6 依据业务需求分析HBase的表设计
    字符串匹配[原始方法]
    括号匹配[栈]
    13.A={1,2,3,5}和为10的问题
    12.回溯递归
    11.字符串{a,b}的幂集[回溯递归]
    10.N个整数中查找是否相加为K[深度搜索]
  • 原文地址:https://www.cnblogs.com/chhuic/p/1596729.html
Copyright © 2011-2022 走看看