code: public 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 獲取到的方法名稱是 <csDemo>b_x_1 這個格式 我想直接獲取到 csDemo
除了字符串截取有其他的方法嗎?
- 2 回答
- 0 關注
- 807 瀏覽
添加回答
舉報
0/150
提交
取消