I have public static class MyClass
which contains many public static string
parameters.
Following I have some value
string val = "something";
Using that val
I want to be able to get specified property - like MyClass.something
.
How can I do that ?
PropertyInfo propertyInfo = typeof(MyClass).GetProperty("something");
string something = (string) propertyInfo.GetValue(null, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With