asp.net 中 HttpRequest 中跟URL path 有关的方法
2010-08-10 13:55
281 查看
对于获取URL path,在HttpRequest 类中已经封装好了很多的相关的方法和属性.
可是在使用中,依然容易被搞迷糊,那个方法是获取相对路径的,那个方法是获取绝对的.
把结果列出来,希望对大家也能有帮助:
请求路径为:
http://localhost:49363/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
各方法产生的结果如下:
Request.RawUrl:
/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
Request.PhysicalPath:
D:\Work\01工程\03编码\01服务器端\ManagementSystemV02.root\ManagementSystemV02\Wap\MISCinterface\StakeOut.aspx
Request.PhysicalApplicationPath:
D:\Work\01工程\03编码\01服务器端\ManagementSystemV02.root\ManagementSystemV02\Wap\
Request.ApplicationPath:
/Wap
Request.AppRelativeCurrentExecutionFilePath:
~/MISCinterface/StakeOut.aspx
Request.CurrentExecutionFilePath:
/Wap/MISCinterface/StakeOut.aspx
Request.PathInfo:
Request.Path:
/Wap/MISCinterface/StakeOut.aspx
Request.Url.AbsolutePath:
/Wap/MISCinterface/StakeOut.aspx
Request.Url.AbsoluteUri:
http://localhost:49363/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
Request.Url.OriginalString:
http://localhost:49363/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
Request.Url.LocalPath:
/Wap/MISCinterface/StakeOut.aspx
可是在使用中,依然容易被搞迷糊,那个方法是获取相对路径的,那个方法是获取绝对的.
把结果列出来,希望对大家也能有帮助:
请求路径为:
http://localhost:49363/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
各方法产生的结果如下:
Request.RawUrl:
/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
Request.PhysicalPath:
D:\Work\01工程\03编码\01服务器端\ManagementSystemV02.root\ManagementSystemV02\Wap\MISCinterface\StakeOut.aspx
Request.PhysicalApplicationPath:
D:\Work\01工程\03编码\01服务器端\ManagementSystemV02.root\ManagementSystemV02\Wap\
Request.ApplicationPath:
/Wap
Request.AppRelativeCurrentExecutionFilePath:
~/MISCinterface/StakeOut.aspx
Request.CurrentExecutionFilePath:
/Wap/MISCinterface/StakeOut.aspx
Request.PathInfo:
Request.Path:
/Wap/MISCinterface/StakeOut.aspx
Request.Url.AbsolutePath:
/Wap/MISCinterface/StakeOut.aspx
Request.Url.AbsoluteUri:
http://localhost:49363/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
Request.Url.OriginalString:
http://localhost:49363/Wap/MISCinterface/StakeOut.aspx?bbcabv=1&&bb=4
Request.Url.LocalPath:
/Wap/MISCinterface/StakeOut.aspx
相关文章推荐
- asp.net 中 HttpRequest 中跟URL path 有关的方法和属性
- asp.net 中 HttpRequest 中跟URL path 有关的方法和属性 (摘自用怪异的眼光去研究blog)
- asp.net 中 HttpRequest 中跟URL path 有关的方法和属性 (摘自用怪异的眼光去研究blog)
- asp.net 中 HttpRequest 中跟URL path 有关的方法和属性
- wp7使用POST请求Asp.net网页时,HttpWebRequest的BeginGetResponse方法抛出NotSupportException异常的解决方法
- ASP.NET 有关Request.Url
- [ASP.NET]Request获取url信息的各种方法比较
- ASP.NET Request获取url信息的各种方法比较 (网摘)
- ASP.NET 取得 Request URL 的各个部分和通过ASP.NET获取URL地址的方法
- ASP.NET的SEO(二):Global.asax和HttpModule中的RewritePath()方法
- ASP.NET 有关Request.Url
- ASP.NET 取得 Request URL 的各个部分和通过ASP.NET获取URL地址的方法
- ASP.NET的SEO--- Global.asax和HttpModule中的RewritePath()方法 (2)
- ASP.NET的SEO--- Global.asax和HttpModule中的RewritePath()方法
- [ASP.NET]Request获取url信息的各种方法比较
- [ASP.NET]从Request.Url获取根网址的最简单方法
- ASP.NET 取得 Request URL 的各个部分和通过ASP.NET获取URL地址的方法
- js_html_input中autocomplete="off"在chrom中失效的解决办法 使用JS模拟锚点跳转 js如何获取url参数 C#模拟httpwebrequest请求_向服务器模拟cookie发送 实习期学到的技术(一) LinqPad的变量比较功能 ASP.NET EF 使用LinqPad 快速学习Linq
- ASP.NET环境下XMLHttpRequest中responseText()方法返回值为空问题讨论