Tips de programacion

Monday, July 31, 2006

 

Mostrar El Call Stack

El siguiente es un proyecto que muestra el CallStack en C#



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace WindowsApplication1
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      (..)
      private void button1_Click(object sender, EventArgs e)
      {
        System.Diagnostics.StackTrace callStack = new System.Diagnostics.StackTrace();
        this.Memo.Clear();
        foreach (System.Diagnostics.StackFrame frame in callStack.GetFrames() )
         {
              this.Memo.AppendText(frame.GetMethod().ToString()+"\n");
         }
    }
  }
}

Thursday, July 20, 2006

 

Primer Post

Primer post bla bla bla bla

Archives

July 2006  

This page is powered by Blogger. Isn't yours?