StackTrace.ToString Method ()

 

Builds a readable representation of the stack trace.

Namespace:   System.Diagnostics
Assembly:  mscorlib (in mscorlib.dll)

Public Overrides Function ToString As String

Return Value

Type: System.String

A readable representation of the stack trace.

The following code example writes stack trace information to an event log entry.

Dim frame As New StackFrame(1, True)
Dim strace As New StackTrace(frame)            

EventLog.WriteEntry(frame.GetMethod().Name, _
                    strace.ToString(), _
                    EventLogEntryType.Warning)

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: