当前位置: 主页 > 编程知识 > asp编程 > 自动获取当前页面URL的ASP函数

自动获取当前页面URL的ASP函数

时间:2010-5-5来源:站长资讯网 点击:

自动获取当前页面URL的ASP函数:


<%
Function GetLocationURL()
Dim Url
Dim ServerPort,ServerName,ScriptName,QueryString
ServerName = Request.ServerVariables("SERVER_NAME")
ServerPort = Request.ServerVariables("SERVER_PORT")
ScriptName = Request.ServerVariables("SCRIPT_NAME")
QueryString = Request.ServerVariables("QUERY_STRING")
Url="http://"&ServerName
If ServerPort <> "80" Then Url = Url & ":" & ServerPort
Url=Url&ScriptName
If QueryString <>"" Then Url=Url&"?"& QueryString
GetLocationURL=Url
End Function
Response.Write GetLocationURL()
%>

站长资讯网
. TAG: 页面URL ASP函数
推荐内容最近更新人气排行
关于我们 | 友情链接 | 网址推荐 | 常用资讯 | 网站地图 | RSS | 留言