/// <summary> /// 单个的方式推送图片消息 /// </summary> public string SendAllBySingle(M_WxImgMsg imgMsg) { string result = ""; List <string> ulist = GetUserList(); for (int i = 0; i < ulist.Count; i++) { imgMsg.ToUserName = ulist[i]; result += SendImgMsg(imgMsg) + ","; } return(result); }
//单个发送,以避开群发,人数多应该单开线程 public string SendAllBySingle(string content) { string result = ""; List <string> ulist = GetUserList(); M_WxImgMsg imgMsg = new M_WxImgMsg(); for (int i = 0; i < ulist.Count; i++) { imgMsg.ToUserName = ulist[i]; result += SendMsg(ulist[i], content) + ","; System.Threading.Thread.Sleep(200); } return(result); }
/// <summary> /// 发送图文消息(用于主动推送) /// </summary> public string SendImgMsg(M_WxImgMsg model) { return(APIHelper.GetWebResult(apiurl + "message/custom/send?access_token=" + AccessToken, "POST", model.ToJson())); }