C# equivalent to Java's Exception.printStackTrace()?

后端 未结 8 1429
刺人心
刺人心 2021-01-31 13:13

Is there a C# equivalent method to Java\'s Exception.printStackTrace() or do I have to write something myself, working my way through the InnerExceptions?

8条回答
  •  野的像风
    2021-01-31 13:33

    http://msdn.microsoft.com/en-us/library/system.exception.stacktrace.aspx

    Console.WriteLine(myException.StackTrace);

提交回复
热议问题