c# 4.5以上通过CallerFilePath获取调用所在类

public void LogHelpers([CallerFilePath] string propertyName = "")
{
this.name = name;
}

posted @ 2018-03-10 22:38  罗曼蒂克'  阅读(259)  评论(0编辑  收藏  举报