ASP获取当前页面URL参数部分函数asp

/ / 2025-03-28   阅读:2562
ASP获取当前页面URL参数部分函数...

用一个自定义函数来获取完整的URL地址,包括全部的参数字符串,自定义函数为GetUrl(),无需参数,用时候直接调用函数就可返回URL。


函数是基于ServerVariables("Script_Name")来编写的,函数返回完整的带参数的URL字符串。


ASP获取当前页面URL参数部分函数代码

Public Function GetUrl()
Dim strTemp
strTemp=Request.ServerVariables("Script_Name")
If  Trim(Request.QueryString)<> "" Then
   strTemp=strTemp&"?"
   For Each M_item In Request.QueryString
    strTemp=strTemp&M_item&"="&Server.UrlEncode(Trim(Request.QueryString(""&M_item&"")))
   next
end if
GetUrl=strTemp'函数返回的结果
End Function


我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈