ASP中获取当前页面的地址与参数的函数
ASP #函数 #页面2012-05-11 13:14
函数代码看下面:
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相关文章
- ASP获取一个数字的个位、十位、百位的函数 2012/05/11
- ASP的Fix、Int、Round、CInt函数用法 2012/05/11
- ASP备份SQL Server数据库 2012/05/11
- ASP下ajax抓取中国天气网天气的代码 2012/05/11
- ASP仿PHP的一些常用函数 2012/05/11
- ASP获取远程网页的指定内容的函数 2012/05/11
- ASP生成SQL命令字符串类 2012/05/11
- ASP文本框换行显示方法 2012/05/11
- ASP页面支持cache的方法 2012/05/11
- ASP的JSON类使用方法 2012/05/11