url问题

lion_lh 2003-10-27 09:43:38
我的页的url是 http://localhost/xxx/aa.asp
我如何得到 http://localhost/xxx/ 这样的字符串,就是去掉aa.asp
...全文
43 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yaozhg 2003-10-27
  • 打赏
  • 举报
回复
<%
Function GetUrl()
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")
strTemp = strTemp & Request.ServerVariables("URL")

strtemp=left(strtemp,instrRev(strtemp,"/"))

GetUrl = strTemp
End Function
Response.write "当前路径为:"&GetUrl()
%>
myxl 2003-10-27
  • 打赏
  • 举报
回复
<%Response.Write(Replace("http://localhost/xxx/aa.asp","aa.asp",""))%>
ygghost 2003-10-27
  • 打赏
  • 举报
回复
在你的iis中 右键属性里--默认文档--把aa.asp添加到里面并且放到首位 OK

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧