• asp.net 获得伪静态网址解决微信sdk签名问题


    手机网站是asp.net c#编写的,前几天因为要使用微信SDK在手机网站页面使用分享功能,但是程序使用了伪静态功能。如果原地址是:http://ww.xx.com/news/show.aspx?id=233。转化过的伪静态地址为http://ww.xx.com/news/show-233.aspx。sdk签名中需要使用使用获得浏览器的动态网址为加入算法作为签名,试了好几种方法都不行。最后找到解决方法,可以使用Request.RawUrl获得伪静态的页面地址。如果大家有更好的方法也可以说下

    测试如下:

    测试的url地址是http://www.test.com/testweb/default.aspx?id=1, 结果如下:

    Request.ApplicationPath: /testweb

    Request.CurrentExecutionFilePath: /testweb/default.aspx

    Request.FilePath: /testweb/default.aspx

    Request.Path: /testweb/default.aspx

    Request.PathInfo:

    Request.PhysicalApplicationPath: E:WWW estweb

    Request.PhysicalPath: E:WWW estwebdefault.aspx

    Request.RawUrl: /testweb/default.aspx?id=1

    Request.Url.AbsolutePath: /testweb/default.aspx

    Request.Url.AbsoluteUri: http://www.test.com/testweb/default.aspx?id=1

    Request.Url.Host: www.test.com

    Request.Url.LocalPath: /testweb/default.aspx

  • 相关阅读:
    JDBC MySQL 实例之 用户管理系统
    利用JDBC连接数据库(MySQL)
    CSS01
    HTML01
    GUI编程02
    GUI编程01
    名词解释
    Navicat MySQL安装
    Eclipse安装Web/JavaEE插件、Eclipse编写HTML代码
    Pascal输出星星
  • 原文地址:https://www.cnblogs.com/fogwang/p/5750141.html
Copyright © 2020-2023  润新知