Mega Code Archive

 
Categories / C# Book / 09 Reflection
 

0609 Type from Assembly

You can retrieve a Type by name. If you have a reference to its Assembly, call Assembly.GetType. using System; using System.Reflection; using System.Collections.Generic; class MainClass { static void Main() { Type t = Assembly.GetExecutingAssembly().GetType("System.String"); Console.WriteLine(t); } }