首页  编辑  

获得多维数组的长度

Tags: /C#/其他技巧/   Date Created:

int [,] vList = new int [,] { { 1 , 2 , 3 }, { 4 , 5 , 6 } };

for ( int i = 0 ; i < vList . GetLength( 0 ); i ++ )

    for ( int j = 0 ; j < vList . GetLength( 1 ); j ++ )

       textBox1 . AppendText(vList[i, j] . ToString() + "\r\n" );