ganwei

 就是吧微信发过来的echoStr原样返回就可以了。

点击提交后微信会向我们填写的服务器发送几个参数,然后需要原样返回出来,所以在提交url的时候,先在服务器创建接口测试返回echostr参数内容

不多说直接上代码: 在一般处理程序创建如下代码就ok了。  

 public void ProcessRequest(HttpContext context)
        {
            string postString = string.Empty;
            string token = "zhulang";//你申请的时候填写的Token

            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 (!String.IsNullOrEmpty(echoString))
            {
                HttpContext.Current.Response.Write(echoString);
                HttpContext.Current.Response.End();
            }
            
        }

 微信URL填写。 提交认证成功。

 

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-12-22
  • 2021-08-04
  • 2021-05-03
  • 2021-06-26
  • 2021-12-12
  • 2021-11-17
  • 2021-12-28
猜你喜欢
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2022-01-17
  • 2022-02-10
  • 2021-11-07
相关资源
相似解决方案