|
Posted on 2009-03-19 15:35 泰仔在线 阅读(199) 评论(0) 编辑 收藏 所属分类: .NET相关
String[][,] items = new String[][,] {
new String[,] {
{ "1", "1", "1", "☆", "○" },
{ "1", "1", "1", "", "" },
{ "1", "1", "1", "", "" },
{ "1", "1", "1", "", "" },
{ "1", "1", "1", "", "" },
{ "1", "1", "1", "", "○" }
},
new String[,] {
{ "1", "1", "1", "", "" }
},
new String[,] {
{ "1", "1", "1", "", "" }
},
new String[,] {
{ "1", "1", "1", "", "", "", "" },
{ "1", "1", "1", "", "", "" },
{ "1", "1", "1", "", "", "", "" },
{ "1", "1", "1", "", "", "", "" },
{ "1", "1", "1", "", "", "", "" },
{ "1", "1", "1", "", "", "", "" },
{ "1", "1", "1", "", "", "", "" }
},
new String[,] {
{ "1", "1", "1", "", "" }
}
};
操作数如下:
System.Console.WriteLine("Items.Rank =" + items[0].Rank);
System.Console.WriteLine("Items.GetUpperBound(0)=" + items[0].GetUpperBound(0));
System.Console.WriteLine("Items.GetUpperBound(1)=" + items[1].GetUpperBound(0));
System.Console.WriteLine("Items[0][0, 0]=" + items[0][0, 0]);
System.Console.WriteLine("Items[0][0, 1]=" + items[0][0, 1]);
System.Console.WriteLine("Items[0][0, 2]=" + items[0][0, 2]);
System.Console.WriteLine("Items[0][0, 3]=" + items[0][0, 3]);
System.Console.WriteLine("Items[0][0, 4]=" + items[0][0, 4]);
System.Console.WriteLine("Items[0][1, 0]=" + items[0][1, 0]);
System.Console.WriteLine("Items[0][1, 1]=" + items[0][1, 1]);
System.Console.WriteLine("Items[0][1, 2]=" + items[0][1, 2]);
System.Console.WriteLine("Items[0][1, 3]=" + items[0][1, 3]);
System.Console.WriteLine("Items[0][1, 4]=" + items[0][1, 4]);
结果如下:
Items.Rank =2
Items.GetUpperBound(0)=5
Items.GetUpperBound(1)=0
Items[0][0, 0]=1
Items[0][0, 1]=1
Items[0][0, 2]=1
Items[0][0, 3]=☆
Items[0][0, 4]=○
Items[0][1, 0]=1
Items[0][1, 1]=1
Items[0][1, 2]=1
Items[0][1, 3]=
Items[0][1, 4]=
|