gpt4 book ai didi

c# - C# 我的应用程序中崩溃报告的最佳实践

转载 作者:行者123 更新时间:2023-11-30 22:48:05 24 4
gpt4 key购买 nike

我需要在我的 C#(WPF) 应用程序上实现崩溃报告框架,所以我需要完整的调用堆栈,你们对此有何建议。

最佳答案

StackTrace

        StackTrace st = new StackTrace(true);
for(int i =0; i< st.FrameCount; i++ )
{
// Note that high up the call stack, there is only
// one stack frame.
StackFrame sf = st.GetFrame(i);
Console.WriteLine();
Console.WriteLine("High up the call stack, Method: {0}",
sf.GetMethod());

Console.WriteLine("High up the call stack, Line Number: {0}",
sf.GetFileLineNumber());
}

关于c# - C# 我的应用程序中崩溃报告的最佳实践,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1912880/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com