/// <summary> /// 订阅 /// </summary> /// <param name="m"></param> /// <returns></returns> private string doSubscribe(SubscribeMsgM m) { string responseContent = string.Empty; responseContent = string.Format(ReplyType.Message_Text, m.FromUserName, m.ToUserName, DateTime.Now.Ticks, "谢谢关注我们"); return(responseContent); }
/// <summary> /// 事件处理 /// </summary> /// <param name="xmldoc"></param> /// <returns></returns> private string eventHandle(XmlDocument xmldoc) { string responseContent = string.Empty; XmlNode Event = xmldoc.SelectSingleNode("/xml/Event"); XmlNode EventKey = xmldoc.SelectSingleNode("/xml/EventKey"); XmlNode ToUserName = xmldoc.SelectSingleNode("/xml/ToUserName"); XmlNode FromUserName = xmldoc.SelectSingleNode("/xml/FromUserName"); if (Event != null) { if (Event.InnerText.Equals("subscribe")) { SubscribeMsgM m = new SubscribeMsgM(); m.FromUserName = FromUserName.InnerText; m.ToUserName = ToUserName.InnerText; m.Event = Event.InnerText; m.EventKey = EventKey.InnerText; responseContent = doSubscribe(m); } else if (Event.InnerText.Equals("CLICK")) { //responseContent = doSelfMenu(xmldoc); } } return(responseContent); }