c# 获取二维数组的行数和列数

static void Main(string[] args)
{
int[,] arr = new int[3, 3] { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 } };
Console.WriteLine("行数:" + arr.Rank);
Console.WriteLine("列数:" + (arr.GetUpperBound(arr.Rank - 1) + 1));
Console.ReadKey();
}

posted @ 2017-12-04 22:23  BeeSnow  阅读(3882)  评论(0编辑  收藏  举报