【发布时间】:2014-01-10 17:30:56
【问题描述】:
我试图只输出 global.asa 应用程序(“SiteURL”),但我什么也没得到 显示为 SiteURL。我在 global.asa 中将其定义为
<!--METADATA TYPE="TypeLib" FILE="c:\Program Files\Common Files\System\ado\msado15.dll" -->
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("SiteURL") = "http://[localhost]/asp3test/"
Application("myAppVariable") = "Apple"
Application("CurrentDateTime") = ""
End Sub
</SCRIPT>
这是我的 test.asp 文件:
<BODY>
Let's retrieve the values of the Application Variables:<P>
myAppVariable = <%= Application("myAppVariable")%><BR>
SiteURL = <%= Application("SiteURL")%> <br />
CurrentDateTime = <%= Application("CurrentDateTime")%><br />
Now, let's set the variables:<HR>
<%
Application.Lock
Application("CurrentDateTime") = Now
Application.UnLock
%>
Variables set - <A HREF="test.asp">click here</A> to reload the page to view
</BODY>
结果:
Let's retrieve the values of the Application Variables:
myAppVariable =
SiteURL =
CurrentDateTime = 12/22/2013 1:47:42 PM
Now, let's set the variables:
Global.asa文件中设置的值好像没有被抓取,喜欢 没有被读取(处理),但是当我手动将值设置为应用程序(变量)时,它似乎保留了它。所以 Global.asa 缺少的东西没有被阅读。我使用的是 IIS 7.5.76 和 Win7(64 位),不确定是否有帮助。
【问题讨论】:
-
我已删除 ASP.NET 标记。 ASP.NET 和 Classic ASP不是一回事。
标签: asp-classic