【发布时间】:2014-04-25 03:09:50
【问题描述】:
我有这个经典的asp代码:
'code start
https = lcase(request.ServerVariables("HTTPS"))
if https <> "off" then prot = "https" else prot ="http"
'use the following for website (non-virtual)
TheURL1 = prot&"://"&Request.ServerVariables("SERVER_NAME")&"/"
'use the following for virtual directory website
TheURL2 = prot&"://"&Request.ServerVariables("SERVER_NAME")&"/Tawanda/NewTawanda/"
'code end
我使用它来确定根 URL(例如http://myserver/),但我注意到当网站配置为虚拟目录时,如果它不是虚拟目录,我必须使用 TheURL2 和 TheURL1。
我的问题是如何确定(在经典 asp 中)网站是否配置为虚拟目录,以便我可以将此代码放在 if... then... 语句中?
【问题讨论】:
标签: asp-classic