Dot-Net

獲取目前方法的名稱

  • January 12, 2010

這是一個愚蠢的問題,但是是否可以從該方法中獲取目前正在執行的方法的名稱?

Public Sub SomeMethod()

  Dim methodName as String = System.Reflection.[function to get the current method name here?]

End Sub

謝謝

System.Reflection.MethodInfo.GetCurrentMethod();

引用自:https://stackoverflow.com/questions/2051217