get member's custom attributes
Published: 18. December 2008 | Updated: 9. October 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Attributes, Framework » Reflection
Tags: Attributes C# Reflection
Import namespace
using System.Reflection;
Code
MemberInfo info = typeof(MyProgram).GetMethod("Test"); object[] attributes = info.GetCustomAttributes(true); foreach (object obj in attributes) { Console.WriteLine(obj); }
| Send us feedback about this snippet » |





