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

问题描述

当发生异常时,您可以打印出StackTrace并查看它。

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

如果您想获取StackTrace而没有发生异常怎么办?

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

有没有办法这样做?

推荐答案

通过调用 Environment.StackTrace

string tracktrace = System.Environment.StackTrace;

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