/// <summary>
        /// 产品版本
        /// </summary>
        public static string AssemblyVersion
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
                if (attributes.Length > 0)
                {
                    AssemblyInformationalVersionAttribute informationalVersionAttribute = (AssemblyInformationalVersionAttribute)attributes[0];
                    if (informationalVersionAttribute.InformationalVersion != "")
                    {
                        return informationalVersionAttribute.InformationalVersion;
                    }
                }
                return Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }        

  

posted on 2017-11-29 16:19  雨悟极  阅读(196)  评论(0编辑  收藏  举报