当前位置:首页 > 网络编程 > WEB编程 > ASP > ASP函数之自动获取当前页面URL

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

点击次数:373 次 发布日期:2008-09-18 15:09:00 作者:源代码网
源代码网推荐

源代码网整理以下自动获取当前页面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()
%>

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华