Overview
- Acts like a StringDictionary which can store multiple values under the same key.
- Values can be retrieved by key or index.
Good practice
- When possible, use a generic collection instead.
Examples
Simple Usage
NameValueCollection valueCollection = new NameValueCollection();
valueCollection.Add("Key1", "Value1");
valueCollection.Add("Key1", "Value2");
valueCollection.Add("Key2", "Value3");
foreach (string s in valueCollection.Keys)
{
Console.WriteLine(valueCollection[s]);
}
You May Also Like

Exam 70-536 Study Notes
My study notes for Microsoft exam 70-536: .NET types, collections, generics, I/O, serialization and more, with C# examples.

Starting Exam 70-536 Study
After a burnout, I'm putting my own project on hold to study for Microsoft exam 70-536.

Design Patterns - Proxy Pattern
The Proxy Pattern, and the last article in the design patterns series, now that I've finished reading Head First Design Patterns.




