Search code examples
c#reflection

C# getting its own class name


If I have a class called MyProgram, is there a way of retrieving "MyProgram" as a string?


Solution

  • Try this:

    this.GetType().Name