示例#1
0
 /// <summary>
 /// 设置测试用户白名单
 /// </summary>
 /// <param name="whitelist"></param>
 /// <returns></returns>
 public static SetTestWhiteListResult SetTestWhiteList(TestWhiteList whitelist)
 {
     WeiXinSDK.WeiXin.CheckGlobalCredential();
     return SetTestWhiteList(whitelist, WeiXinSDK.WeiXin.AppID, WeiXinSDK.WeiXin.AppSecret);
 }
示例#2
0
        /// <summary>
        /// 设置测试用户白名单
        /// </summary>
        /// <param name="whitelist"></param>
        /// <param name="appId"></param>
        /// <param name="appSecret"></param>
        /// <returns></returns>
        public static SetTestWhiteListResult SetTestWhiteList(TestWhiteList whitelist, string appId, string appSecret)
        {
            string url = "https://api.weixin.qq.com/card/testwhitelist/set?access_token=";
            string access_token = WeiXinSDK.WeiXin.GetAccessToken(appId, appSecret);
            url = url + access_token;

            var json = Util.HttpPost2(url, Util.ToJson(whitelist));
            return Util.JsonTo<SetTestWhiteListResult>(json);
        }