C# 获取调用者信息
2021-03-02 03:27
标签:name sharp public attr ace ack trace ons project https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp-5-0 C# 获取调用者信息 标签:name sharp public attr ace ack trace ons project 原文地址:https://www.cnblogs.com/baiqian/p/13061581.html
StackTrace
类 public static void LogWrite(string logInfo,
[CallerFilePath] string file=null,
[CallerLineNumber] int line=0,
[CallerMemberName] string member=null
)
{
Console.WriteLine(logInfo);
Console.WriteLine(file);
Console.WriteLine(line);
Console.WriteLine(member);
}
上一篇:C# NPOI