自动获取当前页面URL的ASP函数:
<% Function GetLocationURL() Dim Url Dim ServerPort,ServerName,ScriptName,QueryString ServerName = Request.ServerVariables("SERVER_NAME") ServerPort = Request.ServerVariables("SERVER_PORT") ScriptName = Request.ServerVariables("SCRIPT_NAME") QueryString = Request.ServerVariables("QUERY_STRING") Url="http://"&ServerName If ServerPort <> "80" Then Url = Url & ":" & ServerPort Url=Url&ScriptName If QueryString <>"" Then Url=Url&"?"& QueryString GetLocationURL=Url End Function Response.Write GetLocationURL() %> |
- 上一篇:生成word文档的asp函数
- 下一篇:清空IE缓存里内容的ASP代码