Get MethodInfo and MemberInfo : MemberInfo : Reflection C# Source Code


Custom Search

C# Source Code » Reflection » MemberInfo »

 

Get MethodInfo and MemberInfo








    
 

using System;
using System.Reflection;

public class Apple {
    public int nSeeds;
    public void Ripen() {
    }
}

public class TypeOfApp {
    static void Main(string[] args) {
        Type t = typeof(Apple);
        string className = t.ToString();

        Console.WriteLine(className);

        Console.WriteLine(className);
        MethodInfo[] methods = t.GetMethods();
        foreach (MethodInfo method in methods) {
            Console.WriteLine(method.ToString());
        }

        Console.WriteLine(className);
        MemberInfo[] allMembers = t.GetMembers();
        foreach (MemberInfo member in allMembers) {
            Console.WriteLine(member.ToString());
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Reflection
» MemberInfo