In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.