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
  • 相关阅读:
    计算机为什么要从 0 开始计数?
    MySQL索引结构为什么是B+树
    expdp导出报错ORA-39127
    expdp 跳过坏块
    (转)没有索引导致的DIRECT PATH READ
    Python的实用场景有哪些
    Oracle索引修复 ,ORA-00600: internal error code, arguments: [6200],
    CentOS7.6静默安装19C实例脚本 ORA-27125 [FATAL] [DBT-10322]
    ORA-00313: 无法打开日志组
    cursor: pin S wait on X等待事件的处理过程(转载)
  • 原文地址:https://www.cnblogs.com/litsword/p/2153451.html
Copyright © 2011-2022 走看看