Пример #1
0
        /// <summary>删除微信公众号菜单</summary>
        /// <remarks>https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141015</remarks>
        public static WechatReply DeleteMenu()
        {
            string url = string.Format("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token={0}", WechatOpen.GetAccessTokenFromServer());

            return(HttpHelper.Get(url).ParseJson <WechatReply>());
        }
Пример #2
0
        /// <summary>设置微信公众号菜单</summary>
        /// <remarks>https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013</remarks>
        /// <example>https://www.cnblogs.com/mchina/p/3276878.html</example>
        public static WechatReply SetMenu(WechatMenu menu)
        {
            var    json = menu.ToJson();
            string url  = string.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", WechatOpen.GetAccessTokenFromServer());

            return(HttpHelper.Post(url, json, Encoding.UTF8, "application/json").ParseJson <WechatReply>());
        }