使用反射.
System.Type;
System.TypeReference;
public static void Main()
{
   MyMath mm=new MyMath();
Console.WriteLine("Calling DoFunc(7).Result:{0}",mm.DoFunc1(7));
System.Reflection.MemberInfo inf=typeof(MyMath);
object[] attributes;
attributes=int.GetCustomAttributes(typeof(BugFixAttribute),false);foreach(Object attribute in attributes)
{
   BugFixAttribute bfa=(BugFixAttribute)attribute;
   Console.WriteLine("\nBugID:{0}",bfa.BugID);
   Console.WriteLine("Programmer:{0}",bfa.Programmer);
    Console.WriteLine                ("Date{0}",bfa.Data);
     Console.WriteLine                ("Comment:{0}",bfa.Comment);
}}