首页 > 代码库 > 企业微信验证数据签名请求

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

 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 else20    HttpContext.Current.Response.Write(Request["echostr"]);

 

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