Search code examples
c#parameterssettingsparameter-passingsettings.settings

How do I form a setting name from a passed parameter?


Say I have a function which recieves a parameter of a string, such as "01" through to "10".

I want to then return the value for one of ym user settings in settings.settings, which have names "Name01", "Name02"... "Name10".

How would I do that?

something similar to:

return (Properties.Settings.Default.Name + str);

Solution

  • return Properties.Settings.Default["Name" + str]