C# 获取调用者信息

  • 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);

        }

https://www.codeproject.com/Tips/606379/Caller-Info-Attributes-in-Csharp-5-0

C# 获取调用者信息

上一篇:yamlapi docker镜像


下一篇:如何查看思科交换机的出厂时间?