byte[] buf = { 1, 2, 3 };
            byte[] buf2 = new byte[3];
            Array.Copy(buf, buf2, 3);
            int hash = buf.GetHashCode();
            int hash2 = buf2.GetHashCode();
///////////////////为什么两个HASH值不同呢,他们都存的一样的值啊。

解决方案 »

  1.   

    byte[] buf = { 1, 2, 3 };
      byte[] buf2 = new byte[3];
      Array.Copy(buf, buf2, 3);
      int hash = buf.GetHashCode();
      int hash2 = buf2.GetHashCode();
    ///////////////////为什么两个HASH值不同呢,他们都存的一样的值啊。
      

  2.   

    你定义了两个对象hash,hash2,存放的物理空间肯定不同了copy只是对值类型进行操作,不可能把对象空间都变得一样的