/// <summary>
/// 向用户发送消息
/// </summary>
/// <param name="openid"></param>
/// <param name="contentText"></param>
private void send(string openid, string contentText)
{
Hashtable where = new Hashtable();
where.Add("access_token", access_token());
string url = "https://api.weixin.qq.com/cgi-bin/message/custom/send";
//定义JSON数据
JObject content = new JObject();
content.Add("content", contentText);
JObject j = new JObject();
j.Add("touser", openid);
j.Add("text", content);
j.Add("msgtype", "text");
string result = Util.HttpRequestPostBody(url, where, j.ToString());
throwErrmsg(result);
}
/// <summary>
微信公众号的开发之 向用户发送消息(三)
最新推荐文章于 2022-12-14 09:15:00 发布