获取堆栈跟踪 [英] Getting the Stacktrace

查看:142
本文介绍了获取堆栈跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当发生异常时,你可以打印出堆栈跟踪和审查。

When Exception happens you can print out the StackTrace and review it.

如果你想要得到的堆栈跟踪无异常情况发生?

What if you want to get the StackTrace without an exception happening?

有没有办法做到这一点?

Is there a way to do this?

推荐答案

您可以通过调用打印出随时堆栈跟踪 Environment.StackTrace

You can print out the stacktrace at any time by calling Environment.StackTrace

string tracktrace = System.Environment.StackTrace;

这篇关于获取堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆