Asp.net development of WeChat public platform (5) WeChat text message

Source: Internet
Author: User
The previous article has successfully responded to the attention event and sent text messages. at the beginning of this article, image and text messages are processed. The most common message type is text and text messages, the most expressive information. The interface definition of text and text messages is as follows: the previous article has successfully responded to the attention event, and has also implemented the sending of text messages. at the beginning of this article, the most common message type is text and text messages, because it is illustrated and illustrated, it is the best way to express information. The interface definition of text message in is as follows:

 
  toUser
  
  fromUser
  
  
   12345678
  
  news
  2
  
   <![CDATA[title1]]> 
   description1
   
   picurl
   
   url
   
  
  
   <![CDATA[title]]>
   description
   
   picurl
   
   url
   
  
 

Add a text definition:

Many people will not understand this document for the first time, because it is not intuitive and can be understood after reading it, developers, users, and time are the same as text messages and other messages. The only difference is that the articles node in text messages is a node with multiple records, which is the same as other nodes, the specific article is equivalent to a sub-level. after reading this article, it is very intuitive to define the text message model. I use the article as a list separately as an attribute in the text message model.

Here we simulate several data records

SNews mN = new SNews (); mN. fromUserName = ReadXml. readModel ("ToUserName", model); mN. toUserName = ReadXml. readModel ("FromUserName", model); mN. createTime = long. parse (ReadXml. readModel ("CreateTime", model); mN. msgType = "news"; // The following is the content of the article. in actual use, this should be a method for interacting with the database and querying the number of articles // Number of articles, the content of the article should be determined by the data queried by the database. here we will test it and simulate several mN entries. articleCount = 5; List listNews = new List (); for (int I = 0; I <6; I ++) {ArticlesModel ma = new ArticlesModel (); ma. title = "this is the first" + I. toString () + "article"; ma. description = "--" + I. toString () + "--"; ma. picUrl =" http://image6.tuku.cn/pic/wallpaper/dongwu/taipingniaogaoqingbizhi/s00 "+ (I + 1). ToString () +". jpg "; ma. Url =" http://www.cnblogs.com/mochen/ "; ListNews. Add (ma);} mN. Articles = listNews; ReadXml. ResponseToEnd (DALWei. SendNews (mN ));


Demo is input? Or? Or help reply to text menu, enter other characters to reply to text

Effect:

For more articles on asp.net development public platform (5) text and text messages, please follow the PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.