Get the App
SLTechnology News&Howtos  ›  Development  › 

How to send Picture and text messages by .net developed by Wechat Public platform

Shulou Source: shulou.com Published: 2022-06-03 15:55:47 11月14日 Update

This article mainly shows you "Wechat public platform development .net how to send picture and text messages", the content is simple and clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Wechat public platform development .net how to send picture and text messages" this article.

Protected string sendPicTextMessage (Msg _ mode,string title,string description,string picurl,string url) {string res = string.Format (@ "{2} 1", _ mode.FromUserName, _ mode.ToUserName, DateTime.Now,title, description, picurl, url); return res;}

You can call the function directly:

Protected void Page_Load (object sender, EventArgs e) {MyMenu (); wxmessage wx = GetWxMessage (); string res = ""; if (! string.IsNullOrEmpty (wx.EventName) & & wx.EventName.Trim () = = "subscribe") {string content = "; content =" /: rose Welcome Beijing Yongjie Youxin Technology Co., Ltd. /: rose\ nreply "Hello" directly; res = sendTextMessage (wx, content) } else if (! string.IsNullOrEmpty (wx.EventName) & & wx.EventName.Trim () = = "CLICK") {if (wx.EventKey== "Hello") res = sendTextMessage (wx, "Hello, welcome to the public Wechat platform of Beijing Yongjie Youxin Technology Co., Ltd."); if (wx.EventKey== "P1") res = sendTextMessage (wx, "Hello, click on Product 1") If (wx.EventKey== "P2") res = sendTextMessage (wx, "Hello, click on product 2");} else {if (wx.MsgType = = "text" & & wx.Content = = "Hello") {res = sendTextMessage (wx, "Hello, welcome to the public Wechat platform of Beijing Yongjie Youxin Technology Co., Ltd.") } if (wx.MsgType = = "text" & & wx.Content = = "Picture and text") {res = sendPicTextMessage (wx, "here is a title", "here is a summary", "https://cache.yisu.com/upload/information/20201208/260/11784.jpg","http://www.4ugood.net");" } else if (wx.MsgType = = "voice") {res = sendTextMessage (wx, wx.Recognition);} else {res = sendTextMessage (wx, "Hello, failed to recognize the message!");}} Response.Write (res);} private wxmessage GetWxMessage () {wxmessage wx = new wxmessage () StreamReader str = new StreamReader (Request.InputStream, System.Text.Encoding.UTF8); XmlDocument xml = new XmlDocument (); xml.Load (str); wx.ToUserName = xml.SelectSingleNode ("xml"). SelectSingleNode ("ToUserName"). InnerText; wx.FromUserName = xml.SelectSingleNode ("xml"). SelectSingleNode ("FromUserName"). InnerText; wx.MsgType = xml.SelectSingleNode ("xml"). SelectSingleNode ("MsgType"). InnerText If (wx.MsgType.Trim () = = "text") {wx.Content = xml.SelectSingleNode ("xml"). SelectSingleNode ("Content"). InnerText;} if (wx.MsgType.Trim () = = "event") {wx.EventName = xml.SelectSingleNode ("xml"). SelectSingleNode ("Event"). InnerText; wx.EventKey = xml.SelectSingleNode ("xml"). SelectSingleNode ("EventKey"). InnerText } if (wx.MsgType.Trim () = = "voice") {wx.Recognition = xml.SelectSingleNode ("xml"). SelectSingleNode ("Recognition"). InnerText;} return wx;} all the contents of this article entitled ".net how to send Picture and text messages for the Development of Wechat Public platform". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Hello platform picture and text message public development company content limited limited technology article Beijing product learning help function summary easy to understand more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info MySQL macOS Microsoft