I want to add multiple int values to my Settings. So far I have this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="DigiPortServer1"
type="Configuration.Helpers.MultipleValuesSelection, Configuration.Helpers"
requirePermission="false"/>
</configSections>
<DigiPortServer1>
<add key="3" value="3"></add>
<add key="4" value="4"></add>
<add key="5" value="5"></add>
<add key="6" value="6"></add>
<add key="7" value="7"></add>
<add key="8" value="8"></add>
<add key="9" value="9"></add>
<add key="10" value="10"></add>
<add key="11" value="11"></add>
<add key="12" value="12"></add>
<add key="13" value="13"></add>
<add key="14" value="14"></add>
<add key="15" value="15"></add>
<add key="16" value="16"></add>
<add key="17" value="17"></add>
<add key="18" value="18"></add>
</DigiPortServer1>
</configuration>
Is this right? I have found many questions considerung multiple String values. How can I access these values? I would like to save these into a int array or something similar.
I would modify your file to be in this way. So it will be easier to access and to work with. This way you can easily access those features by writing
ConfigurationManager.AppSettings["3"].ToString();
Note that your file wasn´t having the keys associated with any values. I added the value atribute.