Mega Code Archive

 
Categories / C# / Reflection
 

Returns all the public constructors defined for the current Type

using System; using System.Reflection; public class MainClass {     public void t() { }     public void t(int i) { }     public static void Main()     {         ConstructorInfo[] p = typeof(MainClass).GetConstructors();         Console.WriteLine(p.Length);         for (int i = 0; i < p.Length; i++)         {             Console.WriteLine(p[i].IsStatic);         }     } }