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

标签:当前页面,地址,参数
0
投稿

猜你喜欢

  • MS SQL7.0的数据迁移到MySQL上的一种方法

    2008-11-01 16:59:00
  • 认识MySQL数据库对服务器端光标的限制

    2009-03-25 17:35:00
  • 数据安全之MySQL安全的二十三条军规

    2008-12-24 16:26:00
  • 讲解MaxDB数据库和MySQL的数据库的主要差别

    2012-02-25 20:04:34
  • 从SNS看社会化界面设计(一)

    2009-02-23 12:21:00
  • 使用ASP脚本命令重新启动服务器

    2008-10-10 11:53:00
  • 用ASP打开远端MDB数据库

    2007-10-13 06:56:00
  • [翻译]标记语言和样式手册 Chapter 13 为文字指定样式

    2008-02-15 16:08:00
  • asp fso type属性取得文件类型代码

    2009-02-04 10:09:00
  • 在SUSE10环境下安装和配置MySQL数据库

    2008-12-17 15:03:00
  • 判断sql语句执行是否成功

    2008-07-05 12:22:00
  • 错误 2812: 未能找到存储过程 'master.dbo.xp_fileexist'

    2010-07-22 19:50:00
  • Css Reset(复位)整理

    2008-09-09 21:58:00
  • ASP技巧:ASP中三个常用语句的使用技巧

    2008-10-16 10:56:00
  • 用VB生成DLL封装ASP代码一个例子:连接access数据库等

    2008-04-07 13:06:00
  • ASP与MySQL的连接[图文教程]

    2010-03-14 11:21:00
  • ASP程序中输出Excel文件实例一则

    2008-11-07 15:29:00
  • IE6 iframe 横向滚动条问题

    2009-01-18 13:31:00
  • 网页设计之步骤和大局观

    2008-03-18 12:50:00
  • IE 下 href 的 BUG

    2008-11-10 12:32:00
  • asp之家 网络编程 m.aspxhome.com