如何在win 8(WinRT)应用程序中获取当前方法名称...在wp7中我们可以使用System.Reflection.MethodBase.GetCurrentMethod().Name但是它不再存在
是的,.NETCore缺少了很多这样的事情......,他们甚至没有得到我开始上GetTypeInfo()!但也许一个实用的解决方法是让编译器为你做这个?
string CallerName([CallerMemberName]string caller = "")
{
return caller;
}
...
string name = CallerName();
Run Code Online (Sandbox Code Playgroud)