Exemple #1
0
        /// <summary>
        /// 向微信服务器请求创建自定义菜单
        /// </summary>
        /// <param name="jsonStr"></param>
        /// <returns></returns>
        public MwxResult AddMenu(string jsonStr)
        {
            //// 处理结果对象
            MwxResult model = null;

            //// 微信API地址
            string interfaceUrl = WebConfigeOpert.GetWXAPIURL();

            interfaceUrl = string.IsNullOrEmpty(interfaceUrl) ? "https://api.weixin.qq.com/" : interfaceUrl;

            //声明一个HttpWebRequest请求
            interfaceUrl = string.Format("{0}cgi-bin/menu/create?access_token={1}", interfaceUrl, WXTokenOpert.GetAccessToken());

            model = PublicTools.HttpPostRequest <MwxResult>(interfaceUrl, jsonStr);

            return(model);
        }
Exemple #2
0
        /// <summary>
        /// 修改用户备注信息
        /// </summary>
        /// <param name="openid">被修改这者的openid</param>
        /// <param name="remark">修改后的备注信息</param>
        /// <returns></returns>
        public MwxResult CheckUserRemark(string openid, string remark)
        {
            //// 处理结果对象
            MwxResult model = null;

            //// 微信API地址
            string wxAPIURL = WebConfigeOpert.GetWXAPIURL();

            //声明一个HttpWebRequest请求
            string interfaceUrl = string.Format("{0}cgi-bin/user/info/updateremark?access_token={1}", wxAPIURL, WXTokenOpert.GetAccessToken());

            string jsonStr = "{" + "\"openid\";" + openid + ",\"remark\":" + remark + "}";

            model = PublicTools.HttpPostRequest <MwxResult>(interfaceUrl, jsonStr);

            return(model);
        }