[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Configuration Manager Settings

Barry

7/25/2008 7:43:00 AM

Hi

is it possible to have a node like the following (appUsers) in the
App.config file in a .Net Framework (2.00) app

<appSettings>
<add key="AppSetting0" value="Monday, February 28, 2005 1:27:59 PM" />
<appUsers>
<add key="user1" value="xxx-1" />
<add key="user2" value="xxx-2" />
<add key="user3" value="xxx-3" />
<add key="user4" value="xxx-4" />
<add key="user5" value="xxx-5" />
</appUsers>
</appSettings>

if not is there a way out of this

TIA
Barry



2 Answers

PvdG42

7/25/2008 1:29:00 PM

0

"Barry" <someone@hello.com> wrote in message
news:#2bvFoi7IHA.3976@TK2MSFTNGP06.phx.gbl...
> Hi
>
> is it possible to have a node like the following (appUsers) in the
> App.config file in a .Net Framework (2.00) app
>
> <appSettings>
> <add key="AppSetting0" value="Monday, February 28, 2005 1:27:59 PM" />
> <appUsers>
> <add key="user1" value="xxx-1" />
> <add key="user2" value="xxx-2" />
> <add key="user3" value="xxx-3" />
> <add key="user4" value="xxx-4" />
> <add key="user5" value="xxx-5" />
> </appUsers>
> </appSettings>
>
> if not is there a way out of this
>
> TIA
> Barry
>
>
Can you elaborate on what you are trying to accomplish with these keys?


Barry

7/25/2008 1:45:00 PM

0


I have an app in which the clients wants to ignore processing of records
which have a specific code (the word User is only for illustration) and the
client want to store these codes in the app.config file

i just want to iterate through the codes (herein called User)

i have used this

<appSettings>
<add key="user1" value="xxx-1" />
<add key="user2" value="xxx-2" />
<add key="user3" value="xxx-3" />
<add key="user4" value="xxx-4" />
<add key="user5" value="xxx-5" />
</appSettings>

in the code i iterate like this

for (int i = 1; i <= 100; i++)
{
string strCode = ConfigurationManager.AppSettings["user" +
i.ToString()];
if (strCode != null)
{
_arrIgnoreCodes.Add(strCode.Trim());
}
}

I find this a bit crude.


"PvdG42" <pvan@toadstool.edu> wrote in message
news:uDlvwpl7IHA.2060@TK2MSFTNGP02.phx.gbl...
> "Barry" <someone@hello.com> wrote in message
> news:#2bvFoi7IHA.3976@TK2MSFTNGP06.phx.gbl...
>> Hi
>>
>> is it possible to have a node like the following (appUsers) in the
>> App.config file in a .Net Framework (2.00) app
>>
>> <appSettings>
>> <add key="AppSetting0" value="Monday, February 28, 2005 1:27:59 PM" />
>> <appUsers>
>> <add key="user1" value="xxx-1" />
>> <add key="user2" value="xxx-2" />
>> <add key="user3" value="xxx-3" />
>> <add key="user4" value="xxx-4" />
>> <add key="user5" value="xxx-5" />
>> </appUsers>
>> </appSettings>
>>
>> if not is there a way out of this
>>
>> TIA
>> Barry
>>
>>
> Can you elaborate on what you are trying to accomplish with these keys?
>
>