If I have a class called MyProgram
, is there a way of retrieving "MyProgram" as a string?
C# getting its own class name
creflection
Related Topic
- C# – Case insensitive ‘Contains(string)’
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- C# – When should I use a struct rather than a class in C#
- C# – Get int value from enum in C#
- C# – Multiline string literal in C#
- C# – Get property value from string using reflection
- C# – How to Sort a List
by a property in the object
Best Answer
Try this: