/// <summary> /// 十六進制字符串異或操做 /// </summary> /// <param name="hex"></param> /// <param name="xor"></param> /// <returns></returns> public static string ConvertHexToXor2(string hex,string xor) { string newstring = ""; for (int i = 0; i < hex.Length; i += 2) { string str = hex.Substring(i, 2); if (xor != "") { newstring += (Convert.ToInt64(xor, 16) ^ Convert.ToInt64(str, 16)).ToString("X2"); } else { xor = str; } } return newstring; }