app.config problem in reading multiple values per key, very stuck no idea

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: app.config problem in reading multiple values per key, very stuck no idea
    ... String[] temp = ... instead it returns a single element array of "Cpu1,test1" in the first ... temp= out of bounds index ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Cell Values from a Closed Workbook
    ... Thank you, Tom. ... GetValues is what JW provided. ... Dim fName As String, sForm as String ... I would like my users to select a closed file, then on an active sheet ...
    (microsoft.public.excel.programming)
  • Re: split question
    ... You should have a single element array returned, ... Remember there are three Split functions in .NET: ... Use Microsoft.VisualBasic.Strings.Split if you need to split a string based ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Determine ParamArray members at runtime?
    ... Public Sub AddTable(strName as string, ParamArray Columns()) ... But this does not work...It simply creates a single element array in ... Public Sub AddTable ...
    (microsoft.public.vb.general.discussion)
  • RE: Selecting
    ... To use Getor GetValues, it depends on what had been saved in the ... If the item in the collection is string, ... if it is an string array, ... Luke ...
    (microsoft.public.dotnet.framework.aspnet.security)