C# 反射的例子

public interface A
{
void A1();
}

public class EEEE:A
{
public void A1()
{
Console.Write("1111111111");
}
}

 

 

static void Main(string[] args)
{

Type o = Type.GetType("ConsoleApplication1.EEEE");

A a = (A)Activator.CreateInstance(o);
a.A1();
Console.WriteLine();
Console.Read();


}

posted @ 2013-02-19 10:02  V青山绿水  阅读(141)  评论(0编辑  收藏  举报