ASP取得URL地址

1:通过Request 获取
http://localhost/QSS/default.aspx
Request.ApplicationPath: /QSS

Request.CurrentExecutionFilePath: /QSS/default.aspx

Request.FilePath: /QSS/default.aspx

Request.Path: /QSS/default.aspx

Request.RawUrl: /QSS/default.aspx 包括查询字符串(如果存在)。

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

Request.Url.AbsoluteUri: http://localhost/QSS/default.aspx

Request.Url.Host: localhost

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

Request.PhysicalApplicationPath:  E:\WWW\QSS\ 

Request.PhysicalPath: E:\WWW\QSS\default.aspx      

 2、通过JS获取                

thisURL   =   document.URL;     

thisHREF   =   document.location.href;      

thisSLoc   =   self.location.href;          

thisDLoc   =   document.location;             

 thisTLoc   =   top.location.href;            

thisPLoc   =   parent.document.location;         

thisTHost   =   top.location.hostname;  

thisHost   =   location.hostname;

tmpHPage   =   thisHREF.split(   "/"   );           

thisHPage   =   tmpHPage[tmpHPage.length-1];           

tmpUPage   =   thisURL.split(   "/"   );            

thisUPage   =   tmpUPage[tmpUPage.length-1];  

 

 

posted @ 2013-04-10 17:53  邪见  阅读(215)  评论(0)    收藏  举报