Global.asa中 [英] Global.asa
问题描述
你好那里:
我的Golbal.asa文件没有解雇或工作,我把它放在root目录里我所有的asp文件,我的网络设置被设置为应用程序,我浏览了互联网对于类似的问题,我仍然无法让它工作。我尝试使用response.WriteApplication(" start")在asp文件中显示应用程序变量,并且浏览器上没有显示任何内容。
我在Windows 2000上运行IIS
任何帮助深表感谢。这是我的golbal.asa文件:
< SCRIPT LANGUAGE =" VBScript" RUNAT =" Server">''我这样做是因为你不能在Session_OnEnd中使用Server.MapPath
''你将不得不修改这个
''反映服务器上的相应路径。
Const strLogFilePath =" C:\ MyFolderName \\\ssion \\ .log"
Sub Application_OnStart
应用程序(开始)=现在()
结束子
Sub Session_OnStart
Session.Timeout = 5
Session(" Start")= Now()
Dim objFSO,objFile
设置objFSO = Server.CreateObject(" Scripting。 FileSystemObject")
设置objFile = objFSO.OpenTextFile(strLogFilePath,8,True)
设置objFSO = Nothing
objFile.WriteLine" Session : &安培; Session.SessionID& "从 &安培;现在()
objFile.Close
设置objFile = Nothing
End Sub
Sub Session_OnEnd
Dim objFSO,objFile
设置objFSO = Server.CreateObject(" Scripting.FileSystemObject")
设置objFile = objFSO.OpenTextFile(strLogFilePath,8,True )
设置objFSO = Nothing
objFile.WriteLine" Session:" &安培; Session.SessionID& "结束于&现在()
objFile.Close
设置objFile = Nothing
End Sub
Sub Application_OnEnd
End Sub
< / SCRIPT>
Hello there:
My Golbal.asa file isn''t firing or working, I put it in the rootdirectory whereall my asp files, my web diectory is set asapplication, I looked throught the internet for similar problembut I am still unable to get it to work. I tried to showapplication variable in asp file by using response.WriteApplication("start") and nothing is showing on the browser.
I am running IIS on windows 2000
Any help is much appreciated. Here is my golbal.asa file:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">'' I do this becauseyou can''t use Server.MapPath
'' in Session_OnEnd... you''ll have to modify this
'' to reflect the appropriate path on your server.
Const strLogFilePath = "C:\MyFolderName\session.log"
Sub Application_OnStart
Application("Start") = Now()
End Sub
Sub Session_OnStart
Session.Timeout = 5
Session("Start") = Now()
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " started at" & Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Session_OnEnd
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " ended at "& Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Application_OnEnd
End Sub
</SCRIPT>
推荐答案
在IIS中重启应用程序,然后检查变量。更改
global.asa文件将显示在新的会话中,但是
Application_OnStart中的代码要求服务实际停止并启动。
-
Gregory A. Beamer
MVP; MCP:+ I,SE,SD,DBA
**************************** ********************
在盒子外面思考!
********* *******************************************
奥萨马雅亚" < OS **** @ lasernetworks.com>在消息中写道
新闻:eq ************** @ TK2MSFTNGP10.phx.gbl ...
您好:
我的Golbal.asa文件没有触发或工作,我把它放在根目录中
whereall我的asp文件,我的web diectory设置为应用程序,我看了
通过互联网解决类似的问题,但我仍然无法得到
工作。我尝试使用
response.Write Application(start)在asp文件中显示应用程序变量,浏览器上没有显示任何内容。
我正在运行IIS Windows 2000
非常感谢任何帮助。这是我的golbal.asa文件:
< SCRIPT LANGUAGE =" VBScript" RUNAT =" Server">''我这样做是因为你不能在Session_OnEnd中使用
Server.MapPath
''你会必须修改这个
''以反映服务器上的相应路径。
Const strLogFilePath =" C:\ MyFolderName \\\ssion.log"
Sub Application_OnStart
申请(开始)=现在()
结束子
子会话_开始
Session.Timeout = 5
会话("开始")=现在()
Dim objFSO,objFile
设置objFSO = Server.CreateObject(" Scripting.FileSystemObject")
设置objFile = objFSO.OpenTextFile(strLogFilePath,8,True)
设置objFSO = Nothing
objFile.WriteLine" Session:" &安培; Session.SessionID& "从 &安培;现在()
objFile.Close
设置objFile = Nothing
End Sub
Sub Session_OnEnd
Dim objFSO,objFile
设置objFSO = Server.CreateObject(" Scripting.FileSystemObject")
设置objFile = objFSO.OpenTextFile(strLogFilePath,8,True )
设置objFSO = Nothing
objFile.WriteLine" Session:" &安培; Session.SessionID& "结束于 &安培;现在()
objFile.Close
设置objFile = Nothing
End Sub
Sub Application_OnEnd
End Sub
< / SCRIPT>
Restart the application in IIS and then check the variable. Changing the
global.asa file will show up in new Sessions, but code in
Application_OnStart requires the service actually stop and start.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************
Think Outside the Box!
************************************************
"Osama Yahya" <os****@lasernetworks.com> wrote in message
news:eq**************@TK2MSFTNGP10.phx.gbl...
Hello there:
My Golbal.asa file isn''t firing or working, I put it in the root directory
whereall my asp files, my web diectory is set as application, I looked
throught the internet for similar problem but I am still unable to get it to
work. I tried to show application variable in asp file by using
response.Write Application("start") and nothing is showing on the browser.
I am running IIS on windows 2000
Any help is much appreciated. Here is my golbal.asa file:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">'' I do this because you can''t use
Server.MapPath
'' in Session_OnEnd... you''ll have to modify this
'' to reflect the appropriate path on your server.
Const strLogFilePath = "C:\MyFolderName\session.log"
Sub Application_OnStart
Application("Start") = Now()
End Sub
Sub Session_OnStart
Session.Timeout = 5
Session("Start") = Now()
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " started at " & Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Session_OnEnd
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFilePath, 8, True)
Set objFSO = Nothing
objFile.WriteLine "Session: " & Session.SessionID & " ended at " & Now ()
objFile.Close
Set objFile = Nothing
End Sub
Sub Application_OnEnd
End Sub
</SCRIPT>
牛仔(Gregory A. Beamer)[MVP]于2004年6月18日写道
microsoft.public.inetserver.asp.general:
Cowboy (Gregory A. Beamer) [MVP] wrote on 18 jun 2004 in
microsoft.public.inetserver.asp.general:
在IIS中重新启动应用程序,然后检查变量。更改
global.asa文件将显示在新的会话中,但是Application_OnStart中的代码要求服务实际停止并启动。
Restart the application in IIS and then check the variable. Changing the
global.asa file will show up in new Sessions, but code in
Application_OnStart requires the service actually stop and start.
你试试:
<%application.abandon%>
< http://BGonly.microsoft.com/?search = plug_pull_out%20ASP>
-
Evertjan。
荷兰。
(请将x''es更改为我的电子邮件地址中的点数。
Did you try:
<% application.abandon %>
<http://BGonly.microsoft.com/?search=plug_pull_out%20ASP>
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)
这篇关于Global.asa中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!