Thursday, November 12, 2009

Reflection Related-Use BindingFlags to retrieve memebers

Type t = typeof(Console);
MemberInfo[] mi = t.GetMembers(
BindingFlags.NonPublic | BindingFlags.Static);
foreach (MemberInfo m in mi)
{
Console.WriteLine("{0}: {1}", m.Name, m.MemberType);
}

No comments: