首页 > 其他 > 详细

C#根据函数名称执行对应的函数

时间:2014-03-12 15:59:41      阅读:325      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
 1 using System;
 2 using System.Collections.Generic;
 3 using System.Reflection;
 4 
 5 namespace test
 6 {
 7     public class test
 8     {
 9         public static void RunSchedule()
10         {
11             test type = Activator.CreateInstance(typeof(test), true) as test;
12 
13             MethodInfo method = type.GetType().GetMethod("f1");
14             method.Invoke(type, null);
15         }
16         private void f1()
17         {
18 
19         }
20         private void f2()
21         {
22 
23         }        
24     }
25 }
bubuko.com,布布扣

C#根据函数名称执行对应的函数,布布扣,bubuko.com

C#根据函数名称执行对应的函数

原文:http://www.cnblogs.com/erictanghu/p/3595907.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!