Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            BLL.wx_response_BaseData   bll   = new BLL.wx_response_BaseData();
            Model.wx_response_BaseData model = new Model.wx_response_BaseData();

            string error = "";

            XCWeiXin.WeiXinComm.WeiXinCRMComm cpp = new XCWeiXin.WeiXinComm.WeiXinCRMComm();
            string accessToken = Token();
            string openId      = openid;
            string contents    = TextBox1.Text;
            string URL_FORMAT  = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}";
            var    data        = new
            {
                touser  = openId,
                msgtype = "text",
                text    = new
                {
                    content = contents
                }
            };

            CommonJsonSend.Send(accessToken, URL_FORMAT, data, timeOut: 1000);

            model.id             = int.Parse(id);
            model.reponseContent = TextBox1.Text;
            bll.updata(model);
            TextBox1.Text = "";
            Response.Redirect("huifu.aspx?openid=" + openid + "");
        }
Exemplo n.º 2
0
        public string stoce()
        {
            WeiXinCRMComm dd     = new WeiXinCRMComm();
            string        error  = "";
            WeiXCommFun   wxcomm = new WeiXCommFun();
            int           wid    = wxcomm.getApiid();
            string        sctokn = dd.getAccessToken(wid, out error);

            return(sctokn);
        }
Exemplo n.º 3
0
        public void gg()
        {
            // SendTextTest("oFo2Hjq6_yMhyz6cQ2MZtmxODOVU");
            string error = "";

            XCWeiXin.WeiXinComm.WeiXinCRMComm cpp = new XCWeiXin.WeiXinComm.WeiXinCRMComm();
            string accessToken = Token();
            string openId      = create;
            string contents    = "Form:requestMessage.Content.ToString";
            string URL_FORMAT  = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}";
            var    data        = new
            {
                touser  = openId,
                msgtype = "text",
                text    = new
                {
                    content = contents
                }
            };

            CommonJsonSend.Send(accessToken, URL_FORMAT, data, timeOut: 1000);
        }