// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Diagnostics; class MainClass { private static void Sub2() { StackTrace trace = new StackTrace(true); for(int i = 0; i < trace.FrameCount; i++) { Console.WriteLine(i + " " + trace.GetFrame(i).GetMethod().Name); } } private static void Sub1() { Sub2(); } public static void Main(string[] args) { Sub1(); } }