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

<%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

Response.Write getCurrentUrl()

Response.Write("<BR><BR>")

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

Response.Write getUrlWithParams()%>

相关文章

数组的定义 Dim MyArray MyArray = Array(1‚5‚123‚12‚98...
\'参数: \'code:要检测的代码 \'leixing:html或者ubb \'n...
演示效果: 代码下载: 点击下载
环境:winxp sp2 ,mysql5.0.18,mysql odbc 3.51 driver 表采...
其实说起AJAX的初级应用是非常简单的,通俗的说就是客户端(j...
<% ’判断文件名是否合法 Function isFilename(aFilename...