新建一个一般处理程序,WechartInterface.ashx
程序代码
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string token = "与网页填写的token保持一致";
if (string.IsNullOrEmpty(token))
{
return;
}
string echoString = HttpContext.Current.Request.QueryString["echoStr"];
string signature = HttpContext.Current.Request.QueryString["signature"];
string timestamp = HttpContext.Current.Request.QueryString["timestamp"];
string nonce = HttpContext.Current.Request.QueryString["nonce"];
if (CheckSignature(token, signature, timestamp, nonce))
{