app.config problem in reading multiple values per key, very stuck no idea
- From: Peted
- Date: Mon, 27 Aug 2007 11:39:23 +0800
hello, i have a app.config file like so
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="rdbUser1Cpu1" value="Cpu1,test"/>
</appSettings>
</configuration>
I understand it is possible to have mutliple values per key that when
you use getvalues is suppoded to return a String[] but it dont seem to
work
Eg
String[] temp;
temp = ConfigurationManager.AppSettings.GetValues("rdbUser1Cpu1");
this compiles and runs fine with no errors except
it does not return a string array with 2 elements houseing each
seperate value
(What i expected was temp[0] =" Cpu1" and temp[1] = "test" )
instead it returns a single element array of "Cpu1,test1" in the first
index.
temp[0] = "Cpu1,test"
temp[1] = out of bounds index
Am i misunderstanding how it should work, or am i doing this wrong.
thanks for any help
Peted
.
- Follow-Ups:
- Prev by Date: Re: URI parse exception
- Next by Date: Re: array with multiple datatypes, how?
- Previous by thread: Bitwise operation returning a long ... how
- Next by thread: Re: app.config problem in reading multiple values per key, very stuck no idea
- Index(es):
Relevant Pages
|