CRL.Business.OnlinePay.ChargeConfig.GetConfigKey C# (CSharp) Метод

GetConfigKey() публичный статический Метод

依赖CustomSetting,名称定义格式为 AlipayKey=key AlipayUser=user [email protected]
public static GetConfigKey ( CompanyType companyType, DataType type ) : string
companyType CompanyType
type DataType
Результат string
        public static string GetConfigKey(CompanyType companyType,DataType type)
        {
            string key = companyType + type.ToString();
            //if (accountKeys.Count == 0)
            //{
            //    string file = System.Web.Hosting.HostingEnvironment.MapPath("/charge/charge.config");
            //    string content = System.IO.File.ReadAllText(file);
            //    string entryKey = "S8S7FLDL";
            //    content = CoreHelper.StringHelper.Decrypt(content, entryKey);
            //    string[] arry = content.Split('\n');
            //    foreach (string str in arry)
            //    {
            //        string[] arry1 = str.Trim().Split('=');
            //        accountKeys.Add(new KeySetting() { Key = arry1[0], Value = arry1[1] });
            //    }
            //}
            //KeySetting set = accountKeys.Find(b => b.Key.ToUpper() == key.ToUpper());
            //if (set != null)
            //    return set.Value;
            string result = CoreHelper.CustomSetting.GetConfigKey(key);
            return result;
        }
ChargeConfig