class b
{
public virtual void fun1(){Console.Writeln("B");}
}
class c:b
{
public override void fun1(){Console.Writeln("c");}
class A
{
public event EventHandler InvokedMethod;
public void InvokeMethod()
{
EventHandler eh=InvokedMethod;
if(eh!=null)
{
eh(this,EventArgs.Empty);
}
}
}
namespace ConsoleApplication1
{
class Test
{
static void Main()
{
a.ReturnC();
}
}
public static class a
{
public static Type ReturnC()
{
Assembly ass = Assembly.Load("ConsoleApplication1");//取得程序集
Type t = typeof(c);//获取类型
c c = (c)ass.CreateInstance(t.FullName);//创建对象
return (Type)t.GetMethod("xxx").Invoke(c, null);//调用实例方法
}
}
public abstract class b
{
//抽象类
public abstract void xxx();
}
public class c : b
{
//实现
public override void xxx()
{
Console.WriteLine("hgfhgf");
}
}
}