Ejemplo n.º 1
0
        /// <summary>
        /// 获取指定规则的MD5。
        /// </summary>
        /// <param name="type">规则类型(国环、北环、CCC)。</param>
        /// <param name="version">规则版本(fill、detect、compare)</param>
        /// <param name="standard">排放标准。</param>
        /// <param name="carType">车辆类型。</param>
        /// <param name="filename">文件绝对路径。</param>
        public static string GetFillRuleMd5(string type, string versionName, string standard, string carType, string filename)
        {
            bool     useStandard = FileHelper.GetUseStandard(versionName, type);
            FileInfo info        = new FileInfo(filename);
            string   name        = info.Name;

            if (string.IsNullOrEmpty(standard) || useStandard == false)
            {
                standard = "All";
            }
            if (string.IsNullOrEmpty(carType))
            {
                carType = "All";
            }
            string version = FileHelper.GetFillVersionByName(versionName);
            string result  = client.fillRuleMdStr(name, type, version, standard, carType);

            try
            {
                ReturnCode code = GetReturn(result);
                if (code.code == "62")
                {
                    return("");
                }
                VerifyReturnCode(code.code);
            }
            catch
            {
                return(result);
            }
            return("");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取指定规则的MD5。
        /// </summary>
        /// <param name="type">规则类型(国环、北环、CCC)。</param>
        /// <param name="version">规则版本(fill、detect、compare)</param>
        /// <param name="standard">排放标准。</param>
        /// <param name="carType">车辆类型。</param>
        /// <param name="filename">文件绝对路径。</param>
        public static string GetFillRuleMd5(string type, string version, string standard, string carType, string filename)
        {
            FileInfo info = new FileInfo(filename);
            string   name = info.Name;

            if (string.IsNullOrEmpty(standard))
            {
                standard = "Default";
            }
            if (string.IsNullOrEmpty(carType))
            {
                carType = name;
            }
            string result = client.fillRuleMdStr(name, type, version, standard, carType);

            if (result == "62")
            {
                return("");
            }
            VerifyReturnCode(result);
            return(result);
        }