// File Reflect1.cs using System; // For Type using System.Reflection; // For MethodInfo class Reflect1 { public static void Main(String [] args) { Type ty = typeof(Reflect1); // Get the Reflect1 class (type) MethodInfo m = ty.GetMethod("Foo"); // Get the Foo method m.Invoke(null, new object[] { }); // Call it } public static void Foo() { Console.WriteLine("Foo"); } }