asp中获取当前页面的地址与参数的函数代码
来源:asp之家 时间:2011-02-20 10:37:00
代码如下:
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
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
MS SQL7.0的数据迁移到MySQL上的一种方法
认识MySQL数据库对服务器端光标的限制
数据安全之MySQL安全的二十三条军规
讲解MaxDB数据库和MySQL的数据库的主要差别
从SNS看社会化界面设计(一)
![](https://img.aspxhome.com/file/UploadPic/20092/23/1-73s.jpg)
使用ASP脚本命令重新启动服务器
用ASP打开远端MDB数据库
[翻译]标记语言和样式手册 Chapter 13 为文字指定样式
![](https://img.aspxhome.com/file/UploadPic/20082/15/2008215162639458s.jpg)
asp fso type属性取得文件类型代码
在SUSE10环境下安装和配置MySQL数据库
判断sql语句执行是否成功
错误 2812: 未能找到存储过程 'master.dbo.xp_fileexist'
Css Reset(复位)整理
ASP技巧:ASP中三个常用语句的使用技巧
用VB生成DLL封装ASP代码一个例子:连接access数据库等
ASP与MySQL的连接[图文教程]
![](https://img.aspxhome.com/file/UploadPic/20093/9/200939182427439s.png)