EventInfo evt = this.button1.GetType().GetEvent("Click", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public);
Assembly sys = Assembly.LoadFile(Application.StartupPath + "\\ClassLibrary1.dll");
Type t = sys.GetType("ClassLibrary1.Class1");
timer = Activator.CreateInstance(t); MethodInfo info = t.GetMethod("button1_Click");
Delegate d = Delegate.CreateDelegate(evt.EventHandlerType, info);//报:绑定到目标方法时出错。 evt.AddEventHandler(this.button1, d);这是什么原因,请指点谢谢
Assembly sys = Assembly.LoadFile(Application.StartupPath + "\\ClassLibrary1.dll");
Type t = sys.GetType("ClassLibrary1.Class1");
timer = Activator.CreateInstance(t); MethodInfo info = t.GetMethod("button1_Click");
Delegate d = Delegate.CreateDelegate(evt.EventHandlerType, info);//报:绑定到目标方法时出错。 evt.AddEventHandler(this.button1, d);这是什么原因,请指点谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货