可能重複:
How can I find the method that called the current method?C#方法調用者
嗨, 我怎樣才能確定從方法中的一個方法的調用者?例如:
SomeNamespace.SomeClass.SomeMethod() {
OtherClass();
}
OtherClass() {
// Here I would like to able to know that the caller is SomeNamespace.SomeClass.SomeMethod
}
感謝
杜佩 - http://stackoverflow.com/問題/ 171970/how-can-i-find-the-method-that-called-the-current-method和http://stackoverflow.com/questions/280413/c-how-do-you-find-the-調用者函數關閉 – William 2009-07-22 06:47:42