Re: Confused by the NameValueCollection

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 05/13/04


Date: Thu, 13 May 2004 13:55:37 +0200

Example 2.

NameValueCollection nvc=new NameValueCollection();

nvc.Add("A","Alpha");

nvc.Add("B","Beta");

nvc.Add("C","Charlie");

nvc.Add("C","Chumpkin");

for(int n=0; n<nvc.Count; n++)

Console.WriteLine(nvc[n]);

foreach(string s in nvc.Keys)

Console.WriteLine(nvc[s]);

-- 
Bob Powell [MVP]
Visual C#, System.Drawing
Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41
"anon" <anon@hotmail.com> wrote in message
news:uksCPmMOEHA.892@TK2MSFTNGP09.phx.gbl...
> I need a little clarity in the NameValueCollection.
>
> Within the MSDN .NET 1.1 Framework help is says:
>
>     "This collection is based on the NameObjectCollectionBase class.
> However, unlike the
>     NameObjectCollectionBase, this class stores multiple string values
under
> a single key."
>
>
>
> What does this REALLY MEAN?
>
> IS THIS CORRECT WAY?
> EXAMPLE #1
> Index     Key    Value
> 0            a        "alpha"
> 1            b        "beta"
> 2            c        "charlie"
> 3            c        "clifford"
>
>
> OR does it mean
> EXAMPLE #2
> Index     Key    Value
> 0            a        "alpha"
> 1            b        "beta"
> 2            c        "charlie", "clifford"
>
>
> see how I am confused?
>
>
>
>


Relevant Pages

  • Re: Confused by the NameValueCollection
    ... NameValueCollection nvc=new NameValueCollection; ... Answer those GDI+ questions with the GDI+ FAQ ... this class stores multiple string values under> a single key." ... > Index Key Value ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Confused by the NameValueCollection
    ... NameValueCollection nvc=new NameValueCollection; ... Answer those GDI+ questions with the GDI+ FAQ ... this class stores multiple string values under> a single key." ... > Index Key Value ...
    (microsoft.public.dotnet.framework)
  • Re: Confused by the NameValueCollection
    ... NameValueCollection nvc=new NameValueCollection; ... Answer those GDI+ questions with the GDI+ FAQ ... this class stores multiple string values under> a single key." ... > Index Key Value ...
    (microsoft.public.dotnet.general)
  • Re: Confused by the NameValueCollection
    ... NameValueCollection nvc=new NameValueCollection; ... Answer those GDI+ questions with the GDI+ FAQ ... this class stores multiple string values under> a single key." ... > Index Key Value ...
    (microsoft.public.dotnet.languages.csharp)