AS.NET Dictionaryの基本的な使い方例を紹介します。


 
Dictionary<string, string> o_Dic = new Dictionary<string, string>();
//
o_Dic.Add("01", "aaa");
o_Dic.Add("02","bbb");
// key
if (!o_Dic.ContainsKey("03"))
{
o_Dic.Add("03", "ccc");
}
//
o_Dic.Remove("03");
//
string a = o_Dic["02"];
// v
foreach (KeyValuePair<string, string> kvp in o_Dic)
{
Response.Write(kvp.Key + "," + kvp.Value);
}
// vkey
foreach (string s in o_Dic.Keys) { }
// vvalue
foreach (string s in o_Dic.Values) { }