You can't write code exactly like you want and there is no syntactic sugar to get you close to desired syntax.
This usually achieved by using dictionary. Not sure what type of Deafult
is but assuming it is some sort of IDictionary
code would look like:
var pSettings = Properties.Settings.Default[settingName];
Another option is to use reflection and get property by name - Get property value from string using reflection in C#, sample from that question:
public static object GetPropValue(object src, string propName)
{
return src.GetType().GetProperty(propName).GetValue(src, null);
}
var pSettings = (string)GetPropValue(Properties.Settings.Default, settingName);