首页 > 应用开发 > > Action action 获取方法名称问题
ublic void ExecuteVoidFunc(Action action,string methodName="")
{
if (action == null) return ;
try
{
action.Invoke();
}
catch (Exception ex)
{
string temp = (methodName + "").Length == 0 ? action.Method.Name : methodName;
}
}Action是个委托方法 希望获取他的调用他的方法名称
action.Method.Name 获取到的方法名称是
除了字符串截取有其他的方法吗?
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/818/viewspace-3130523/ ,如需转载,请注明出处,否则将追究法律责任。