Get the name of the current method

后端 未结 5 937
野的像风
野的像风 2021-02-06 20:05

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 SomeMetho         


        
5条回答
  •  被撕碎了的回忆
    2021-02-06 20:40

    The other methods are close to what was asked, but they don't return the string value. But this does:

    Dim methodName$ = System.Reflection.MethodBase.GetCurrentMethod().Name
    

提交回复
热议问题