예제 #1
0
파일: WxAPI.cs 프로젝트: baixue001/IPS
        /// <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);
        }
예제 #2
0
        //单个发送,以避开群发,人数多应该单开线程
        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);
        }
예제 #3
0
 /// <summary>
 /// 发送图文消息(用于主动推送)
 /// </summary>
 public string SendImgMsg(M_WxImgMsg model)
 {
     return(APIHelper.GetWebResult(apiurl + "message/custom/send?access_token=" + AccessToken, "POST", model.ToJson()));
 }