• Winform 版本信息


    #region Assembly Attribute Accessors

    public string AssemblyTitle
    {
    get
    {
    object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
    if (attributes.Length > 0)
    {
    AssemblyTitleAttribute titleAttribute
    = (AssemblyTitleAttribute)attributes[0];
    if (titleAttribute.Title != "")
    {
    return titleAttribute.Title;
    }
    }
    return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
    }
    }

    public string AssemblyVersion
    {
    get
    {
    return Assembly.GetExecutingAssembly().GetName().Version.ToString();
    }
    }

    public string AssemblyDescription
    {
    get
    {
    object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
    if (attributes.Length == 0)
    {
    return "";
    }
    return ((AssemblyDescriptionAttribute)attributes[0]).Description;
    }
    }

    public string AssemblyProduct
    {
    get
    {
    object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
    if (attributes.Length == 0)
    {
    return "";
    }
    return ((AssemblyProductAttribute)attributes[0]).Product;
    }
    }

    public string AssemblyCopyright
    {
    get
    {
    object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
    if (attributes.Length == 0)
    {
    return "";
    }
    return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
    }
    }

    public string AssemblyCompany
    {
    get
    {
    object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
    if (attributes.Length == 0)
    {
    return "";
    }
    return ((AssemblyCompanyAttribute)attributes[0]).Company;
    }
    }
    #endregion
  • 相关阅读:
    ruby中nil?, empty? and blank?
    dialog插件demo
    Oauth2.0 QQ&微信&微博实现第三方登陆
    SSM框架应用
    点击<a>标签后禁止页面跳至顶部
    使用Node.js+Hexo+Github搭建个人博客(续)
    软件项目托管平台
    【转载】 Eclipse注释模板设置详解
    Markdown 简介及基础语法
    SpringMVC简介
  • 原文地址:https://www.cnblogs.com/litsword/p/2153451.html
Copyright © 2020-2023  润新知