using System;
using System.ComponentModel;
using System.Reflection;
class TestDesc
{
[Description("Number")]
public int Count
{
get {return _count;}
set {_count= value;}
}
int _count;
public static void Main()
{
Type t = typeof(TestDesc);
MemberInfo[] mis = t.GetMember("Count");
foreach (Attribute a in mis[0].GetCustomAttributes(typeof(DescriptionAttribute),false))
{
Console.WriteLine(((DescriptionAttribute)a).Description);
}
}
}
Type t = typeof(test );
System.ComponentModel.DescriptionAttribute[] at =(System.ComponentModel.DescriptionAttribute[]) t.GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false);
Response.Write(at[0].Description);