C# 对比两个byte[]是否一样
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)] static extern int ByteEquals(byte[] b1, byte[] b2, long count); /// <summary> /// 比较数组 /// </summary> /// <param name="b1"></param> /// <param name="b2"></param> /// <returns></returns> static bool ByteArrayCompare(byte[] b1, byte[] b2) { return b1.Length == b2.Length && ByteEquals(b1, b2, b1.Length) == 0; }