码迷,mamicode.com
首页 > Windows程序 > 详细

C#在函数内部获取函数的参数

时间:2016-07-09 12:02:17      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:

foreach (var parameter in typeof(类名).GetMethod("方法名").GetParameters())
            {
                Console.WriteLine(parameter.ParameterType);//参数类型
                Console.WriteLine(parameter.Position);//参数位置
                Console.WriteLine(parameter.Name);//参数名
            }

 

C#在函数内部获取函数的参数

标签:

原文地址:http://www.cnblogs.com/zhchsh/p/5655519.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!