企业微信验证数据签名请求

 1 string signature = Request["signature"];
 2 string timestamp = Request["timestamp"];
 3 string nonce     = Request["nonce"];
 4 
 5 List<string> list = new List<string>();
 6 
 7 list.Add(appToken);
 8 list.Add(timestamp);
 9 list.Add(nonce);
10 
11 list.Sort();
12 
13 StringBuilder sb = new StringBuilder();
14 foreach(string s in list)
15    sb.Append(s);
16 
17 if(signature.ToUpper() != System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sb.ToString(),"SHA1"))
18    HttpContext.Current.Response.Write("非法的验证");
19 else
20    HttpContext.Current.Response.Write(Request["echostr"]);

 

企业微信验证数据签名请求

上一篇:微信分享,使用js,分享给朋友,朋友圈,QQ微博


下一篇:微信订阅号(第五个版本)总结