private static string StandardSerial = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; /// <summary> /// 计算快速服务代码 /// </summary> /// <param name="serialNo">服务编号</param> /// <returns></returns> public static string GetServiceCode(string serialNo) { if (serialNo.Length != 7) return string.Empty; serialNo = serialNo.ToUpper(); Int64 ServiceCode = 0; for (int i = 0; i < 7; i++) { ServiceCode += Convert.ToInt64(Math.Pow(36, 6 - i) * StandardSerial.IndexOf(serialNo[i])); } return ServiceCode.ToString(); }