System.Collections.Specialized.NameValueCollection myCollection
= new System.Collections.Specialized.NameValueCollection();
myCollection.Add("Arcane", "http://arcanecode.com");
myCollection.Add("PWOP", "http://dotnetrocks.com");
myCollection.Add("PWOP", "http://dnrtv.com");
return collection;
}
static void Main()
{
NameValueCollection collection = GetCollection();
foreach (string key in collection.AllKeys) // <-- No duplicates returned.
{
Console.WriteLine(key);
}
}
This is the way to add values to collection.
now i need to add string value as key and list value as values like
myCollection.Add(readstring,list[i].aaaa);
which not getting added for me