Get Type full name and base type and its members : Field « Reflection « C# / CSharp Tutorial






using System;
using System.Reflection;
public class TypeInfo
{
  public static void Main(String[] args)
  {
    Type ct = Type.GetType(args[0]);
    Console.WriteLine(ct.FullName+" : "+ct.BaseType);
    MemberInfo[] members = ct.GetMembers();
    foreach (MemberInfo member in members)
    {
      Console.WriteLine("-->"+member);
    }
  }
}








19.4.Field
19.4.1.Get all fields from a Type
19.4.2.List Fields
19.4.3.Deeper Reflection: iterate through the fields of the class
19.4.4.Get/set a field using a FieldInfo
19.4.5.Reflecting On Members Of A Type
19.4.6.Get Type full name and base type and its members