C# getting its own class name

creflection

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

Best Answer

Try this:

this.GetType().Name