Have a problem with below code in global.asa. Same problem as described in
this news group before, IWAM_machinenam e did not solve my problem.
Have created the following test code (file is never deleted on my IIS6
Win2003
environment, any idea?):
<SCRIPT LANGUAGE="VBScr ipt" RUNAT="Server">
Sub Application_OnS tart
End Sub
Sub Session_OnStart
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct")
objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Session_OnEnd
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct")
objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Application_OnE nd
End Sub
</SCRIPT>
/Propin 4 6822
Propin wrote on 26 apr 2005 in microsoft.publi c.inetserver.as p.general: Have a problem with below code in global.asa. Same problem as described in this news group before, IWAM_machinenam e did not solve my problem. Have created the following test code (file is never deleted on my IIS6 Win2003 environment, any idea?):
<SCRIPT LANGUAGE="VBScr ipt" RUNAT="Server"> Sub Application_OnS tart
End Sub
Sub Session_OnStart
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct")
objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Session_OnEnd
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct")
objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Application_OnE nd
End Sub
</SCRIPT>
Elementary, my dear Propin:
There is no code to delete any file in the above whatever,
only multiple creation of the same.
True?
===============
More seriously and as said so many times in this NG:
Leave Session_OnEnd alone.
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
Deleted or overwritten ?
When do you expect it will happen ?
Any specific error ?
Perhaps http://support.microsoft.com/kb/277329/en-us
Overall what would you like to do ? My personal preference is to avoid
Session_OnEnd (could not fire in case of problem, not the same security
context, out of the "normal" execution flow etc...)
--
"Propin" <fr************ *@malmoaviation .se> a écrit dans le message de
news:%2******** ********@TK2MSF TNGP14.phx.gbl. .. Have a problem with below code in global.asa. Same problem as described in this news group before, IWAM_machinenam e did not solve my problem. Have created the following test code (file is never deleted on my IIS6 Win2003 environment, any idea?):
<SCRIPT LANGUAGE="VBScr ipt" RUNAT="Server"> Sub Application_OnS tart
End Sub
Sub Session_OnStart
Set objFileSystemOb ject =
Server.CreateOb ject("Scripting .FilesystemObje ct") objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Session_OnEnd
Set objFileSystemOb ject =
Server.CreateOb ject("Scripting .FilesystemObje ct") objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Application_OnE nd
End Sub
</SCRIPT>
/Propin
Ofcourse, in the session_OnEnd createfile should be replaced by DeleteFile.
My misstake when copying the code. The file is never deleted, sometimes the
event pops upp in event viewer (but not all the time..):
"Failed to impersonate the Anonymous User for ASP Application
/LM/W3SVC/1/ROOT. Global.ASA OnEnd routines will not be executed."
To test different users all of these are configured on the folder:
Locla Administrators
ASPNET
IWAM_xxxxxxxx
Network
Network Service
System
Local Users
/Propin
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29... Propin wrote on 26 apr 2005 in microsoft.publi c.inetserver.as p.general:
Have a problem with below code in global.asa. Same problem as described in this news group before, IWAM_machinenam e did not solve my problem. Have created the following test code (file is never deleted on my IIS6 Win2003 environment, any idea?):
<SCRIPT LANGUAGE="VBScr ipt" RUNAT="Server"> Sub Application_OnS tart
End Sub
Sub Session_OnStart
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct")
objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Session_OnEnd
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct")
objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Application_OnE nd
End Sub
</SCRIPT>
Elementary, my dear Propin: There is no code to delete any file in the above whatever, only multiple creation of the same.
True?
===============
More seriously and as said so many times in this NG: Leave Session_OnEnd alone. -- Evertjan. The Netherlands. (Replace all crosses with dots in my emailaddress)
This does not apply to IIS6 on Win2003, it is also only a problem when I
need to connect to network recources. I have this problem on local disc
access.....Othe r ideas?
"Patrice" <no****@nowhere .com> wrote in message
news:un******** ******@TK2MSFTN GP09.phx.gbl... Deleted or overwritten ? When do you expect it will happen ? Any specific error ? Perhaps http://support.microsoft.com/kb/277329/en-us
Overall what would you like to do ? My personal preference is to avoid Session_OnEnd (could not fire in case of problem, not the same security context, out of the "normal" execution flow etc...)
--
"Propin" <fr************ *@malmoaviation .se> a écrit dans le message de news:%2******** ********@TK2MSF TNGP14.phx.gbl. .. Have a problem with below code in global.asa. Same problem as described in this news group before, IWAM_machinenam e did not solve my problem. Have created the following test code (file is never deleted on my IIS6 Win2003 environment, any idea?):
<SCRIPT LANGUAGE="VBScr ipt" RUNAT="Server"> Sub Application_OnS tart
End Sub
Sub Session_OnStart
Set objFileSystemOb ject = Server.CreateOb ject("Scripting .FilesystemObje ct") objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Session_OnEnd
Set objFileSystemOb ject =
Server.CreateOb ject("Scripting .FilesystemObje ct") objFileSystemOb ject.CreateText File "C:\temp\error\ Test.txt", True
Set objFileSystemOb ject = Nothing
End Sub
Sub Application_OnE nd
End Sub
</SCRIPT>
/Propin
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tom Bates |
last post by:
I can successfully delete files using fso.DeleteFile when in an ASP
script. But in Session_OnEnd, where I'd *really* like to clean up
files, it appears that DeleteFile doesn't work. I've tried every
combination I could think of. I've verified the filespecs I'm using by
logging to a session log file.
BTW, I found out the hard way that I can't reference
Request.ServerVariables("APPL_PHYSICAL_PATH") from within
Session_OnEnd. I had to copy...
|
by: cab |
last post by:
i have the following code in the "Sub Session_OnEnd" routine that does not
seem to run.....
Sub Session_OnEnd
strConnect = "Driver={SQL Server};Server=SERVER;Database=database; User
ID=xxxxxx;Pwd=xxxxxxx"
Set objConnEnd = Server.CreateObject("ADODB.Connection")
objConnEnd.Open strConnect
|
by: Nancy Drew |
last post by:
hi all
i'm trying to keep users from being able to login to a site twice at the
same time. everytime a user does a login, i stick their userID into an
application scoped array. if they try to login again, i bounce them to an
error page. i use the session_onEnd sub within global.asa to remove their
userID from the array at the end of their session, and this seems to work
fine. however, if i just shut down the browser, the sub_onEnd...
|
by: Agoston Bejo |
last post by:
Hi!
Why doesn't the following code work?
Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = Application("Connection_String")
Conn.Open 'here is the error
....
End Sub
|
by: Olivier SOW |
last post by:
Hi,
I have this code in the global.asa file:
Sub Session_OnEnd()
Set oFso= CreateObject("Scripting.FileSystemObject")
Set oFileTxt= oFso.OpenTextFile("c:\debugS.txt", 8, true)
oFileTxt.WriteLine Now()&" SESSION END "&session.sessionId
Set oFso= nothing: Set oFileTxt= nothing
| |
by: andrea azzini |
last post by:
I've got an ASP3 (IIS6) site, in which some scripts need to generate
temporary files in order to work. Now, the fact is: I would like those
temporary files to be deleted when a user's session ends (even though i've
got infinite hosting space, i feel it somewhat impolite to leave GB's of
useless temp files ;-) ).
The Session_OnEnd event, though, seems to have some problems in doing this:
1. I found in MSDN that it couldn't call...
|
by: anand |
last post by:
In my website i want to trace the event when user log off
from the site by closing the explorer so i am unable to
run any server side program at that time and my
session_onend event also not working can any one tell me
why the session_onend is not working.
Thanx in advance
|
by: Martin |
last post by:
Hi,
Since I went ASP.NET with my global.asa (making it a global.asax) the
application events are called just fine as well as the Session_OnStart event
but the Session_OnEnd event is not. What is wrong? My global.asax looks like
this:
<%@ Application src="app.cs" Inherits="mwte.App" %>
|
by: Andy Kasotia |
last post by:
My Session_OnStart works but Session_OnEnd does not work. Here's the
code...can anyone tell me what's wrong with my code or if anything else
on the server that needs to be changed. The Session_OnStart does create
the folder for me with the SessionID as the folder name but
Session_OnEnd does not delete that folder.
Sub Session_OnStart
Dim fso, f, DirToCreate
'Create a folder to store PDF Files
Set fso =...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |