请注意,guid.ToByteAray()不会返回可以传递给BigInteger的数组.要使用该数组,需要重新排序和尾随零,以确保Biginteger将byteArray视为正数(请参阅MSDN文档).一个简单但性能较差的功能是:
private static string GuidToStringUsingStringAndParse(Guid value)
        {
            var guidBytes = string.Format("0{0:N}", value);
            var bigInteger = BigInteger.Parse(guidBytes, NumberStyles.HexNumber);
            return bigInteger.ToString("N0", CultureInfo.InvariantCulture);
        }