HttpContext.Current.Request.Url.ToString() 并不可靠. 如果当前URL为 http://localhost/search.aspx?user=http://csharp.xdowns.com&tag=%BC%BC%CA%F5 通过HttpContext.Current.Request.Url.ToString()获取到的却是 http://localhost/search.aspxuser=http://csharp.xdowns.com&tag=…
辣么多属性.方法  不用就忘了  ,当需要用的时候挠头也想不到,现在总结一下 以备用 例如:http://localhost/testweb/default.aspx 1.Request.ApplicationPath;  获取服务器上ASP.NET应用程序的虚拟应用程序根路径 2.Request.AppRelativeCurrentExecutionFilePath;  获取应用程序根的虚拟路径,使用~使成为相对路径3. Request.CurrentExecutionFilePath;  获…
HttpServletRequest 获取请求的URL的方法有: 1.request.getRequestURL() 返回的是完整的url,包括Http协议,端口号,servlet名字和映射路径,但它不包含请求参数.2.request.getRequestURI() 得到的是request URL的部分值,并且web容器没有decode过的 3.request.getContextPath() 返回 the context of the request. 4.request.getServlet…
JavaScript&jQuery获取url参数方法 function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r!=null) return unescap…
1.JS获取当前页面URL的方法小结 ①. document.URL;                           http://localhost:81/Test/1.htm/id/12 ②. document.location.href;  http://localhost:81/Test/1.htm/id/12 ③. self.location.href; http://localhost:81/Test/1.htm/id/12 ④. document.location  http…
Location对象 location用于获取或设置窗体的URL,并且可以用于解析URL. 语法: location.[属性|方法] location对象属性图示: location 对象属性: location 对象方法: 任务 在右边编辑器script标签内,获取当前显示文档的URL,并输出. <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content=&quo…
设置或获取对象指定的文件名称或路径.window.location.pathname 设置或获取整个 URL 为字符串.window.location.href; 设置或获取与 URL 关联的端口号码.window.location.port 设置或获取 URL 的协议部分. window.location.protocol 设置或获取 href 属性中在井号"#"后面的分段.window.location.hash 设置或获取 location 或 URL 的 hostname 和…
进行加密,加密后的参数中有个+号: 前端的url:http://mtest.cmread.com:8145/nap/p/QRcode.jsp?activityId=11206&vcode=O/QCFFCUg+AaGN90ISkXIw==&isJsConsole=true 后进行断点调试发现端获取到的字符串,+号变成了空格: O/QCFFCUg AaGN90ISkXIw== 根据加密解密规则进行解密后,发现解密后的阅读号乱码了,去调接口直接抛异常: 后来度娘了一下,需要对加密的字段进行转义:…
//jQuery 动态给a 标签赋值 跳转 新的页面打开. /* <a class="btn btn-success" id="test" target="_Black" >点击查看列表 >></a> */ 此时需要双层 encodeURI(encodeURI()); $('#test').on('click',function(){ var batch =$('#zhongwen').val(); //获得中…
1.request.getRequestURL() 返回的是完整的url,包括Http协议,端口号,servlet名字和映射路径,但它不包含请求参数.2.request.getRequestURI() 得到的是request URL的部分值,并且web容器没有decode过的 3.request.getContextPath() 返回 the context of the request. 4.request.getServletPath() 返回调用servlet的部分url. 5.reque…