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(); }
转载于:https://www.cnblogs.com/BeeSnow/p/7979332.html
相关资源:C#获取多维数组的行数与列数.rar