byte[] bs, byte[] bt;
byte[] bw = new byte[bt.Length + bs.Length];
Array.Copy(bs, 0, bw, bt.Length, bs.Length);
Copy(a,b,n);三个参数的我知道是把a的n个参数复制到b,那么5个参数的是什么意思哦?谢谢各位!

解决方案 »

  1.   

    是不是把bs的第0开始复制到bw的第bt.Length开始,长度是bs.Length;对不?
      

  2.   

    YES!完全 可以敲出代码,看看 NET的参数说明,就了解诶!
      

  3.   

    5个参数分别是:
    sourceArray
    类型:System..::.Array
    Array,它包含要复制的数据。sourceIndex
    类型:System..::.Int32
    一个 32 位整数,它表示 sourceArray 中复制开始处的索引。destinationArray
    类型:System..::.Array
    Array,它接收数据。destinationIndex
    类型:System..::.Int32
    一个 32 位整数,它表示 destinationArray 中存储开始处的索引。length
    类型:System..::.Int32
    一个 32 位整数,它表示要复制的元素数目。
      

  4.   

    Array.Copy(sourceArray,sourceIndex,destinationArray,destinationIndex,length)不是这样用的。Copy(A,0,B,1,2)
    的意思是,把A从0开始的2个元素COPY到B的第一位开始。
      

  5.   

    http://msdn.microsoft.com/zh-cn/library/z50k9bft.aspx
      

  6.   

                byte[] bs = new byte[] { 1, 2, 3 };
                byte[] bt = new byte[3];
                Array.Copy(bs, 0, bt, 0, bs.Length);指复制多少个元素过去。
      

  7.   


    A: 1  2  3  4  5
    B: 11 12 13 14 15如果是Copy(A,0,B,3,2)
    结果就是A不变,B变成 11 12 13 1 2