Dumping the call stack programmatically

前端 未结 4 547
清酒与你
清酒与你 2021-02-03 19:25

Looking for a way to programmatically dump the call stack and a .net Win Forms app when ever a section of code is hit. Its something I haven\'t come across before but will save

4条回答
  •  野性不改
    2021-02-03 19:37

    System.Environment.StackTrace
    

    Will give you the current stack as a string.

    You can also use the StackTrace class as others have pointed out if you have more advanced needs.

提交回复
热议问题