"anon" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):
> What if the values have a "comma" in them? How is the
> comma-separated list going to know where the next "REAL" value
> is?
Use the GetValues() method:
using System;
using System.Collections.Specialized;
namespace ExampleNamespace
{
public class TestForm
{
[STAThread]
public static void Main()
{
NameValueCollection nvc = new NameValueCollection();
nvc.Add("A","Alpha");
nvc.Add("B","Beta");
nvc.Add("C","Charlie 1,Charlie sub-1");
nvc.Add("C","Charlie 2");
foreach(string key in nvc.Keys)
{
Console.WriteLine("Key = {0}", key);
// A key may point to multiple values. Process
// the values individually by using the GetValues method.
foreach(string value in nvc.GetValues(key))
Console.WriteLine(" Value = {0}", value);
}
}
}
}
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/