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 + ""); }
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); }
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); }