System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(); System.Diagnostics.StackFrame[] frames = trace.GetFrames(); foreach (System.Diagnostics.StackFrame stackFrame in frames) { //stackFrame.GetMethod(); //stackFrame.GetMethod().DeclaringType.FullName; }You could also just call trace.GetFrame() with an index to get a specific method on the stack.
Dim trace As System.Diagnostics.StackTrace = New System.Diagnostics.StackTrace() Dim frames As System.Diagnostics.StackFrame() = trace.GetFrames() For Each stackFrame As System.Diagnostics.StackFrame In frames 'stackFrame.GetMethod(); 'stackFrame.GetMethod().DeclaringType.FullName; Next