protected Dictionary<string , string> xmlList = new Dictionary<string , string>();
protected System.Collections.ArrayList list = new System.Collections.ArrayList();
このような配列リストに辞書を保存しました..
xmlList.Add( "image" , "images/piece1.png" );
xmlList.Add( "description" , " Experience why entertainment is more amazing with Xbox." );
xmlList.Add( "title" , "Downloads" );
list.Add( xmlList );
xmlList.Clear();
xmlList.Add( "image" , "images/piece2.png" );
xmlList.Add( "description" , "Limited-time offer: Buy Office now, get the next version free.*" );
xmlList.Add( "title" , "Security & Updates" );
list.Add( xmlList );
配列リストから辞書の各要素にアクセスするにはどうすればよいですか?
<% for (int i = 0; i < list.Count; i++)
{
foreach(Dictionary<string , string> itemList in list)
{
Response.Write( itemList["image"] );
}
}
%>
そして、それは私に同じ結果「images/piece2.png」を2回与えます..
できなかった
foreach(Dictionary<string , string> itemList in list[i])
{
Response.Write( itemList["image"] );
}