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);
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.