zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    cento7快速修改主机名和修改root密码
    [goolegke]nginxingress建立测试
    filebeat安装读取nginx json日志
    MySQL索引背后的数据结构及算法原理
    Lua脚本在redis分布式锁场景的运用
    Sentinel实现限流
    java架构技术流程图
    mybatis数据加解密处理方案
    vue 自定义代码片段
    node项目vue 自动化部署之pm2
  • 原文地址:https://www.cnblogs.com/litsword/p/2153451.html
Copyright © 2011-2022 走看看