博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C#中获取应用程序集特性
阅读量:4315 次
发布时间:2019-06-06

本文共 506 字,大约阅读时间需要 1 分钟。

//获取程序集的特性方法

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);
   }
  }

转载于:https://www.cnblogs.com/ganquanfu2008/archive/2013/04/11/3015174.html

你可能感兴趣的文章
XSS安全漏洞解决办法后记
查看>>
圆圈舞蹈 题解
查看>>
在程序中添加Game Center功能
查看>>
System类 和 Runtime 类
查看>>
poj3308
查看>>
R语言里的因子factor
查看>>
Web API系列(一)设计经验与总结
查看>>
快速排序OC、Swift版源码
查看>>
Openstack API学习
查看>>
IE10 For Windows 7 预览版开放下载
查看>>
FreeBSD 9.1 正式版已经可以下载
查看>>
Telerik ASP.NET AJAX Q1 2013支持持久化框架和iOS6
查看>>
整合 Ext JS 和第三方类库
查看>>
靶形数独【贪心+深搜】
查看>>
读大道至简第三章有感
查看>>
BeforeFieldInit的小叙
查看>>
TeamViewer的下载地址,低调低调
查看>>
005 线程ID和线程的优先级
查看>>
POJ 3067 Japan (树状数组 && 控制变量)
查看>>
python基础条件和循环
查看>>