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
  • 相关阅读:
    leetcode78 Subsets
    leetcode76 Minimum Window Substring
    leetcode73 Set Matrix Zeroes
    leetcode70 Climbing Stairs
    leetcode50 Pow(x, n)
    leetcode49 Group Anagrams
    leetcode48 Rotate Image
    正则表达式及字符处理
    RPM软件包管理.作业
    yum管理RPM包.作业
  • 原文地址:https://www.cnblogs.com/litsword/p/2153451.html
Copyright © 2011-2022 走看看