如何用asp.net代码获取 url地址呢,本文分享一种方法。
测试用url地址:http : //www.test.com/testweb/default.aspx
结果如下:
request.applicationpath: /testweb
request.currentexecutionfilepath: /testweb/default.aspx
request.filepath: /testweb/default.aspx
request.path: /testweb/default.aspx
request.physicalapplicationpath: e:"www"testwebrequest.physicalpath:
request.physicalpath: e:"www"testweb"default.aspx
request.rawurl: /testweb/default.aspx
request.url.absolutepath: /testweb/default.aspx
request.url.absoluteurl: http://www.test.com/testweb/default.aspx
request.url.host: www.test.com
request.url.localpath: /testweb/default.aspx