In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to access asp.net in the development of Wechat. It is very detailed and has a certain reference value. Interested friends must finish reading it!
First create a Default.aspx. Check it out in Page_Load: (MyLog is a log class, which can be ignored) about checkSignature () is pretty much what we found. Post it here.
MyLog.DebugInfo ("request default.aspx"); String echoStr = Request.QueryString ["echostr"]; MyLog.DebugInfo ("echoStr:" + echoStr); if (this.checkSignature ()) {if (! string.IsNullOrEmpty (echoStr)) {MyLog.DebugInfo ("echostr:" + echoStr); Response.Write (echoStr); Response.End ();}}
The most important thing is the sentence Response.End (). If you don't add this sentence, you can't get it in. About checkSignature () is about the same as what we found. Post it here.
Private bool checkSignature () {string signature = Request ["signature"]; string timestamp = Request ["timestamp"]; string nonce = Request ["nonce"]; MyLog.DebugInfo ("signature: {0}, timestamp: {1}, nonce: {2}", signature, timestamp, nonce); string token = TOKEN; string [] tmpArr = new string [] {token, timestamp, nonce}; Array.Sort (tmpArr); string tmpStr = string.Join ("", tmpArr) / / sha1 encryption System.Security.Cryptography.SHA1 sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider (); byte [] secArr = sha1.ComputeHash (System.Text.Encoding.Default.GetBytes (tmpStr)); tmpStr = BitConverter.ToString (secArr) .replace ("-", ") .ToLower (); MyLog.DebugInfo (String.Format (" after parse: {0} ", tmpStr)); if (tmpStr = = signature) {MyLog.DebugInfo (" true "); return true;} else {return false } these are all the contents of the article "how to connect to asp.net in Wechat development". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.