c# - Get dynamic property from Settings -


i've got few properties stored in appconfig , want access them dynamically (e.g. in loop or function).

accessing values using mysettings.name_of_that_thing no problem, if name variable?

i tried:

string propertyvalue = mysettings.gettype().getproperty("name_of_that_thing").tostring(); 

but thing got name of property. how can this?

string propertyvalue = mysettings.gettype() .getproperty("name_of_that_thing") .getvalue(mysettings, null); //replace mysettings null in getvalue(...) if mysettings  static class 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -