Mega Code Archive

 
Categories / C# / Reflection
 

Call static method GetType from Type to get the Type instance

using System; using System.Text; class MainClass{         public static void Main()         {             Type t2 = Type.GetType("System.String");             Type t3 = Type.GetType("System.String", true);             Type t4 = Type.GetType("system.string", true, true);             Type t5 = Type.GetType("System.Data.DataSet, System.Data,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");        } }