Example #1
0
        /// <summary>
        /// 配置名称的前缀,将根据前缀从 配置文件 (app.config,web.config)
        ///  或者 List&lt;NameAndValue&gt; 去寻找对应的名称来配置值;
        /// </summary>
        public WechatConfig(string prefix, List <INameAndValue> configList)
        {
            Name           = prefix;
            Token          = NameAndValue.GetValueFromConfig(prefix + ".token", configList);
            EncodingAesKey = NameAndValue.GetValueFromConfig(prefix + ".encodingAesKey", configList);
            AppId          = NameAndValue.GetValueFromConfig(prefix + ".appId", configList);
            AppSecret      = NameAndValue.GetValueFromConfig(prefix + ".appSecret", configList);
            MchId          = NameAndValue.GetValueFromConfig(prefix + ".mchId", configList);
            TenPayNotify   = NameAndValue.GetValueFromConfig(prefix + ".tenPayNotify", configList);
            var contentAndModify = AppDomainUtil.GetMapPathContentAndLastModifyTime("/bin/" + prefix + ".menuDefine");

            if (contentAndModify != null)
            {
                MenuDefine = Newtonsoft.Json.JsonConvert.DeserializeObject <ButtonGroup>(contentAndModify.Content);
                MenuDefineModifyDateTime = contentAndModify.LastModifyDatetime;
            }
        }
Example #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="prefix"></param>
 /// <param name="configList"></param>
 public WechatWorkConfig(string prefix, List <INameAndValue> configList)
     : base(prefix, configList)
 {
     CorpId = NameAndValue.GetValueFromConfig(prefix + ".corpId", configList);
 }