Skip to main content
syntax coloring
Source Link
Victor Stafusa
  • 8.8k
  • 5
  • 40
  • 61

C#

First post, so please go easy on me.

class Program
{
    static void Main()
    {
        new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Invoke(null, null);
    }
}
class Program
{
    static void Main()
    {
        new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Invoke(null, null);
    }
}

This simply creates a stack trace, grabs the top frame (which will be our last call to Main()), gets the method, and invokes it.

C#

First post, so please go easy on me.

class Program
{
    static void Main()
    {
        new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Invoke(null, null);
    }
}

This simply creates a stack trace, grabs the top frame (which will be our last call to Main()), gets the method, and invokes it.

C#

First post, so please go easy on me.

class Program
{
    static void Main()
    {
        new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Invoke(null, null);
    }
}

This simply creates a stack trace, grabs the top frame (which will be our last call to Main()), gets the method, and invokes it.

Source Link
BenM
  • 1.4k
  • 11
  • 11

C#

First post, so please go easy on me.

class Program
{
    static void Main()
    {
        new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Invoke(null, null);
    }
}

This simply creates a stack trace, grabs the top frame (which will be our last call to Main()), gets the method, and invokes it.