At the moment, the parameter is saved as

Properties.Settings.Default.us_PathBD = value; Properties.Settings.Default.Save(); 

Is it possible to access the parameter by specifying the name as a string?

  • What for? What do you mean by parameter? If us_PathBD then this field or property is user2455111

2 answers 2

 Properties.Settings.Default["us_PathBD"] = value; 

    If there is no indexer, as in the previous answer, then you can set the field using reflections

      var info = typeof(MyClass).GetField("MyPropName"); info.SetValue(typeof(MyClass), "PropValue"); 

    for the property, just need to use the method

     typeof(MyClass).GetProperty(...);