private void Test()
{
int[,] a = new int[3, 4] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 } };
int len1 = a.GetLength(0);
int len2 = a.GetLength(1);
int[] b = new int[len1 * len2];
for (int i = 0; i < len1; i++)
{
for (int j = 0; j < len2; j++)
{
b[i * len2 + j] = a[i, j];
}
}
}