日期:2014-05-17 浏览次数:20769 次
using System; public class RankExample { public static void Main() { int[] oneDAry = new int[5]; int[,] twoDAry = new int[2,3]; for (int i = 0; i < 2; i++ ) { oneDAry.SetValue( i, i ); } try { Array.Copy( oneDAry, twoDAry, 2); } catch ( RankException e ) { Console.WriteLine( "Error caught: {0}", e ); } } }