Something like this should work:
var value = (string)GetType().GetProperty("SomeProperty").GetValue(this, null);
More Related Contents:
- How do I get the path of the assembly the code is in?
- Set object property using reflection
- How can I evaluate C# code dynamically?
- How to Load an Assembly to AppDomain with all references recursively?
- How can I get all classes within a namespace?
- How to get a list of properties with a given attribute?
- Call static method with reflection
- What’s the difference between System.Type and System.RuntimeType in C#?
- Use reflection to invoke an overridden base method
- Fast creation of objects instead of Activator.CreateInstance(type)
- Get a generic method without using GetMethods
- How can I create an instance of an arbitrary Array type at runtime?
- Using IsAssignableFrom with ‘open’ generic types
- Discovering derived types using reflection
- How do I create a generic class from a string in C#? [duplicate]
- Get all types implementing specific open generic type
- Determine if a type is static
- Dynamic table name in linq [duplicate]
- How can you loop over the properties of a class?
- GetEntryAssembly for web applications
- Why is TargetInvocationException treated as uncaught by the IDE?
- Finding all Namespaces in an assembly using Reflection (DotNET)
- Using GetProperties() with BindingFlags.DeclaredOnly in .NET Reflection
- Comparing Object properties using reflection
- Implementations of interface through Reflection
- IsAssignableFrom() returns false when it should return true
- How to recursively print the values of an object’s properties using reflection
- Get derived class type from a base’s class static method
- How to use Activator to create an instance of a generic Type and casting it back to that type?
- Run a method before all methods of a class