测试的url地址是http://www.gkxsn.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\testweb\
Request.PhysicalPath: E:\WWW\testweb\default.aspx
Request.RawUrl: /testweb/default.aspx?id=1
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUri: http://www.gkxsn.com/testweb/default.aspx?id=1
Request.Url.Host: www.gkxsn.com
Request.Url.LocalPath: /testweb/default.aspx
Response.Write("<b>Request.ApplicationPath:</b> " + Request.ApplicationPath + "<br>");
Response.Write("<b>Request.CurrentExecutionFilePath:</b> " + Request.CurrentExecutionFilePath + "<br>");
Response.Write("<b>Request.FilePath:</b> " + Request.FilePath + "<br>");
Response.Write("<b>Request.Path:</b> " + Request.Path + "<br>");
Response.Write("<b>Request.PathInfo:</b> " + Request.PathInfo + "<br>");
Response.Write("<b>Request.PhysicalApplicationPath:</b> " + Request.PhysicalApplicationPath + "<br>");
Response.Write("<b>Request.PhysicalPath:</b> " + Request.PhysicalPath + "<br>");
Response.Write("<b>Request.RawUrl:</b> " + Request.RawUrl + "<br>");
Response.Write("<b>Request.Url.AbsolutePath:</b> " + Request.Url.AbsolutePath + "<br>");
Response.Write("<b>Request.Url.AbsoluteUri:</b> " + Request.Url.AbsoluteUri + "<br>");
Response.Write("<b>Request.Url.Host:</b> " + Request.Url.Host + "<br>");
Response.Write("<b>Request.Url.LocalPath:</b> " + Request.Url.LocalPath + "<br>");
http://www.itpob.cn
分享到:
相关推荐
//获取完整url (协议名+域名+站点名+文件名+参数) string fullUrl = Request.Url.ToString(); //获取客户端请求的URL信息(不包括主机和端口) string rawUrl = Request.RawUrl;...//获取服务器上ASP.NET应
【ASP.NET编程知识】asp.net获取URL和IP地址的方法汇总.docx
通过webrequest, webclient两种方式请求url获取对应的返回值
通过 webrequest,webclient两种方法请求远程url,获取返回值
asp.net获取URL和IP地址的方法汇总,需要的朋友可以参考一下
本文总结分析了.Net获取URL中文参数值的乱码问题解决方法。分享给大家供大家参考,具体如下: 解决方法: 1.设置web.config文件 2.传递中文之前,将要传递的中文参数进行编码,在接收时再进行解码。 string ...
用 asp.net获取当前网页地址的一些信息。
ASP.NET2.0 c# 获取浏览器,IP,URL,操作系统
ASP.NET C# URL重写 地址重写 伪静态 转HTML
C#获取当前页面的url 和JavaScript 获取当前页面的URL
获取Url的方法有两种,通过后台获得或通过前面js获得,如下: 1、通过C#获取当前页面的URL string url = Request.Url.AbsoluteUri; //结果: //www.jb51.net/web/index.aspx string host = Request.Url.Host; //结果...
Java获取URL内容的,我这里只给出GET方式的,POST和其它方式的都是比较类似的。其技术要点就一下三点。 第一:创建HttpURLConnection 第二:打开URL,创建一个InputStream 第三:逐行(逐字节)读取,如果需要,转换...
asp.net实现URL的伪静态,重写URL地址
在ASP.NET中,如果你使用了URL重写,通过HttpContext.Request获取到的是重写后的地址。如果这个地址要返回给客户端(比如Redirect),我们一般希望是重写前的友好地址。
//获取从wxProcess.aspx传递过来的跳转地址reurl if (Request.QueryString["reurl"] != null && Request.QueryString["reurl"] != "") { reurl = Request.QueryString["reurl"].ToString(); } string code = ...
微信授权获取用户基本信息 //nickname = outputObj1["nickname"].ToString(); //昵称 //sex = outputObj1["sex"].ToString(); //性别 headimgurl = outputObj1["headimgurl"].ToString(); //头像url //province ...
Request.UrlReferrer Request.ServerViables[“http_referer”] Request.RawUrl Request.RawUrl.QueryAndPath System.IO.Path.GetFileName(Request.FilePath.ToString()) 在ASP.NET编程中经常需要用Request获取url的...
先看实例 代码如下: function webChart() { var t = document.getElementById(“txtReceive”); if (t.value == null || t.value == “”) { alert(“请先进行查询”); } else { alert(...