码迷,mamicode.com
首页 > 其他好文 > 详细

获取类的描述信息 DescriptionAttribute

时间:2017-09-07 10:10:22      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:adk   att   sys   nat   system   rgs   test   component   script   

        static void Main(string[] args)
        {
            var attrs = typeof(TestClass).GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), true);
            if (attrs.Length > 0)
            {
                var descriptionAttribute = attrs[0] as System.ComponentModel.DescriptionAttribute;
                if (descriptionAttribute != null)
                    Console.WriteLine(descriptionAttribute.Description);
            }
            Console.ReadKey();
        }

 

获取类的描述信息 DescriptionAttribute

标签:adk   att   sys   nat   system   rgs   test   component   script   

原文地址:http://www.cnblogs.com/ideacore/p/7487979.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!