获取当前方法的名称 [英] Get the name of the current method
本文介绍了获取当前方法的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个愚蠢的问题,但是是否有可能从该方法中获取当前正在执行的方法的名称?
This is kind of a silly question, but is it possible to get the name of the method that is currently being executed from within that method?
Public Sub SomeMethod()
Dim methodName as String = System.Reflection.[function to get the current method name here?]
End Sub
谢谢
推荐答案
System.Reflection.MethodInfo.GetCurrentMethod();
这篇关于获取当前方法的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文