I'm writing a program that is using the <appSettings>
section of the app.config file to get the variables. Here's an example of my situation currently:
string ip = ConfigurationManager.AppSettings["IP"];
string var1 = ConfigurationManager.AppSettings["Var1"];
string var2 = ConfigurationManager.AppSettings["Var2"];
string remotePath = @"\\" + ip + @"\C";
and the app.config file looks something like this:
<appSettings>
<add key="IP" value="<ip address here>" />
<add key="Var1" value="variable1" />
<add key="Var2" value="variable2" />
</appSettings>
This all works fine and I'm okay with keeping it this way. My problem is simply that I think it looks ugly. I've been looking around to find out if keys can be nested so I can do something like this with another key:
<add key="RemotePath" value="\\" + IP + "\C" />
I know variables aren't easily possible in app.config, and my problem isn't really big enough to make me interested in doing a lot of work, I'm just interested if key nesting is possible? I haven't been able to find any hint of a yes or no from Google.