2009-12-16 15 views

Répondre

3

StackTrace

 StackTrace st = new StackTrace(true); 
     for(int i =0; i< st.FrameCount; i++) 
     { 
      // Note that high up the call stack, there is only 
      // one stack frame. 
      StackFrame sf = st.GetFrame(i); 
      Console.WriteLine(); 
      Console.WriteLine("High up the call stack, Method: {0}", 
       sf.GetMethod()); 

      Console.WriteLine("High up the call stack, Line Number: {0}", 
       sf.GetFileLineNumber()); 
     } 
+0

probablement mieux de se connecter à un fichier, au lieu de la console. –

+0

Je montre juste comment obtenir une trace de cheminée Ankur, ce n'est pas une application réelle –