随笔分类 - C#_反射
摘要:http://www.cnblogs.com/chenxizhang/archive/2010/03/13/1685179.html今天在讲到动态执行方法的时候,我们讨论到了Delegate.CreateDelegate的方法。但也有下面这样的一个更加通用的方法:可以执行任何方法,传递任意个数的参数,而无需定义delegate using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace ConsoleApplication1
阅读全文
摘要:下面代码是今天课程中,有朋友上台做即席演讲时举的一个例子.这个例子不错,概括了动态调用方法的几种情况,包括静态方法,实例方法,方法重载等等using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { //MyClass obj...
阅读全文

浙公网安备 33010602011771号