Mega Code Archive

 
Categories / C# Book / 09 Reflection
 

0614 Type Names

A type has Namespace, Name, and FullName properties. In most cases, FullName is a composition of the former two: using System; using System.Reflection; using System.Collections.Generic; class MainClass { static void Main() { Type t = typeof(System.Text.StringBuilder); Console.WriteLine(t.Namespace); // System.Text Console.WriteLine (t.Name); // StringBuilder Console.WriteLine (t.FullName); // System.Text.StringBuilder } } The output: System.Text StringBuilder System.Text.StringBuilder