asp获取当前页面url

来源:互联网 发布:东方财富网 数据 编辑:程序博客网 时间:2024/05/16 16:00
<%
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()
%>

function getcenter(str,a,b)'str是字符串
  getcenter=split(split(str,a)(1),b)(0)
end function
Response.Write getcenter(GetLocationURL(),"=","")

0 0
原创粉丝点击