首页 > 技术文章 > c# 4.5以上通过CallerFilePath获取调用所在类

aaaaq 2018-03-10 22:38 原文

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

推荐阅读