Ejemplo n.º 1
0
        /// <summary>
        /// 处理信息并应答
        /// </summary>
        private void Handle(string postStr)
        {
            WechatMsg msg = new WechatMsg();

            msg.WriteLog(postStr);
            string responseContent = msg.ReturnMessage(postStr);

            HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
            HttpContext.Current.Response.Write(responseContent);
        }
Ejemplo n.º 2
0
        private string GetLotteryPlanByCode(WechatMsg wechatMsg)
        {
            var    respMsg  = new StringBuilder(wechatMsg.ResponseMsg + ":\r\n");
            string msg      = "";
            var    planList = lotteryServer.GetPlanList((int)wechatMsg.Sid, out msg);

            var count = 1;

            LogHelper.Logger.Info("取到的计划:" + planList.Count);
            if (planList.Count > 0)
            {
                foreach (var plan in planList)
                {
                    respMsg.Append(plan.PlanName + ":\r\n" + plan.PlanUrl + "\r\n");
                    count++;
                }
            }
            else
            {
                respMsg.Append("计划库中还没有存在该类型的计划");
            }
            return(respMsg.ToString());
        }