当前页面的地址与参数 asp中获取当前页面的地址与参数的函数代码

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

当前页面的地址与参数 asp中获取当前页面的地址与参数的函数代码

  2021-03-18 我要评论
想了解asp中获取当前页面的地址与参数的函数代码的相关内容吗,在本文为您仔细讲解当前页面的地址与参数的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:当前页面,地址,参数,下面大家一起来学习吧。
复制代码 代码如下:

Function getCurrentUrl()
On Error Resume Next
Dim strTemp
If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "http://"
Else
strTemp = "https://"
End If
strTemp = strTemp & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then
strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT")
end if
strTemp = strTemp & Request.ServerVariables("URL")
getCurrentUrl = strTemp
End Function

Function getUrlWithParams()
Dim ScriptAddress,Servername,qs
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME"))
Servername = CStr(Request.ServerVariables("Server_Name"))
qs=Request.QueryString
If Request.ServerVariables("SERVER_PORT") <> 80 Then
Servername = Servername & ":" & Request.ServerVariables("SERVER_PORT")
end if
if qs<>"" then
getUrlWithParams ="http://"& Servername & ScriptAddress &"?"&qs
else
getUrlWithParams ="http://"& Servername & ScriptAddress
end if
End Function

猜您喜欢

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们