G
Guest
Here's my App.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="customers">
<section name="test1"
type="System.Configuration.DictionarySectionHandler" />
<section name="test2"
type="System.Configuration.DictionarySectionHandler" />
</sectionGroup>
</configSections>
<appSettings>
<add key="ConnectionString" value="some value here" />
</appSettings>
<customers>
<test1>
<add key="CustCode" value="0001" />
<add key="FtpHost" value="ftp://xxx.com" />
<add key="FtpAccount" value="user1" />
<add key="FtpPassword" value="password1" />
<add key="Active" value="Y" />
</test1>
<test2>
<add key="CustCode" value="0002" />
<add key="FtpHost" value="ftp://yyy.com" />
<add key="FtpAccount" value="user2" />
<add key="FtpPassword" value="password2" />
<add key="Active" value="Y" />
</test2>
</customers>
</configuration>
If I know the 'CustCode' value (such as "0001"), how can I retrieve all the
other values for 'test1'?
I appreciate your help! Thank you.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="customers">
<section name="test1"
type="System.Configuration.DictionarySectionHandler" />
<section name="test2"
type="System.Configuration.DictionarySectionHandler" />
</sectionGroup>
</configSections>
<appSettings>
<add key="ConnectionString" value="some value here" />
</appSettings>
<customers>
<test1>
<add key="CustCode" value="0001" />
<add key="FtpHost" value="ftp://xxx.com" />
<add key="FtpAccount" value="user1" />
<add key="FtpPassword" value="password1" />
<add key="Active" value="Y" />
</test1>
<test2>
<add key="CustCode" value="0002" />
<add key="FtpHost" value="ftp://yyy.com" />
<add key="FtpAccount" value="user2" />
<add key="FtpPassword" value="password2" />
<add key="Active" value="Y" />
</test2>
</customers>
</configuration>
If I know the 'CustCode' value (such as "0001"), how can I retrieve all the
other values for 'test1'?
I appreciate your help! Thank you.