C# 微信开发者模式调用的时候总显示token验证失败
publicvoidWxIndex(){//signature微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce...
public void WxIndex()
{
//signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。
//timestamp 时间戳
//nonce 随机数
//echostr 随机字符串s
string signature = HttpContext.Request["signature"];
string timestamp = HttpContext.Request["timestamp"];
string nonce = HttpContext.Request["nonce"];
string echostr = HttpContext.Request["echostr"];
string Token = "hgc2015";
string[] wxstring = { Token, timestamp, nonce };
Array.Sort(wxstring);
string temp2 = string.Join("", wxstring);
string TEMP3 = FormsAuthentication.HashPasswordForStoringInConfigFile(temp2, "SHA1");
if (TEMP3.ToLower().Equals(signature))
{
Response.Write(echostr);
Response.End();
}
} 展开
{
//signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。
//timestamp 时间戳
//nonce 随机数
//echostr 随机字符串s
string signature = HttpContext.Request["signature"];
string timestamp = HttpContext.Request["timestamp"];
string nonce = HttpContext.Request["nonce"];
string echostr = HttpContext.Request["echostr"];
string Token = "hgc2015";
string[] wxstring = { Token, timestamp, nonce };
Array.Sort(wxstring);
string temp2 = string.Join("", wxstring);
string TEMP3 = FormsAuthentication.HashPasswordForStoringInConfigFile(temp2, "SHA1");
if (TEMP3.ToLower().Equals(signature))
{
Response.Write(echostr);
Response.End();
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询