Beispiel #1
0
        /// <summary>
        /// 创建菜单
        /// </summary>
        public static void CreateMenuPage()
        {
            var posturl = string.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", PartenerInfo.IsTokenExpired());
            var content = PartenerInfo.GetPage(posturl, MyMenu);

            HttpContext.Current.Response.Write(content);
        }
Beispiel #2
0
        protected void btngo_Click(object sender, EventArgs e)
        {
            string res          = "";
            string access_token = PartenerInfo.IsTokenExpired();

            string posturl  = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + access_token;
            string postData = "{\"touser\":\"" + UserName.Text + "\",\"msgtype\":\"text\",\"text\":{\"content\":\"" + txtMsg.Text + "\"}}";

            res = PartenerInfo.GetPage(posturl, postData);

            Response.Write(res);
        }