关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

微信发送文本消息方法

发布时间:2019-11-13 11:15:23

  微信发送文本消息方法代码分享如下:

CRMComm wxComm = new CRMComm(); //获取AccessToKen类
            string error = string.Empty;
            string accessToken = wxComm.GetAccessToken(out error);
            //CustomApi.SendText(accessToken, CookieHelper.GetCookie("openid"), "nihao");
            string urlformat = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={0}";
 
            var data = new
            {
                touser = CookieHelper.GetCookie("openid"),
                msgtype = "text",
                text = new
                {
                    content = "你好吗,吃了吗"
                }
            };
            Senparc.Weixin.CommonAPIs.CommonJsonSend.Send(accessToken, urlformat, data);



/template/Home/Zkeys/PC/Static