473,471 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application object

Hi all,
If I read the contents of a file in the Application_Start event and store
it in the Application object so that the contents is available to all
sessions, what is the best way to remove the contents from memory when all
sessions have ended? Is there any better alternative to do this?
Thanks.
Nikhil
Nov 18 '05 #1
3 907
You could keep the file in the Cache object. The ASP.NET cache will
automatically remove items using a least recently used algorithm. You
can also hook up a CacheDependency to invalidate the cached file it it
changes during runtime.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 12 Oct 2004 09:20:02 -0400, "Nikhil Patel"
<do*******@nospaml.com> wrote:
Hi all,
If I read the contents of a file in the Application_Start event and store
it in the Application object so that the contents is available to all
sessions, what is the best way to remove the contents from memory when all
sessions have ended? Is there any better alternative to do this?
Thanks.
Nikhil


Nov 18 '05 #2
There is a Remove option on the application object and Application_End event
I believe
"Nikhil Patel" <do*******@nospaml.com> wrote in message
news:eG*************@tk2msftngp13.phx.gbl...
Hi all,
If I read the contents of a file in the Application_Start event and store it in the Application object so that the contents is available to all
sessions, what is the best way to remove the contents from memory when all
sessions have ended? Is there any better alternative to do this?
Thanks.
Nikhil

Nov 18 '05 #3
Nikhil Patel wrote:
Hi all,
If I read the contents of a file in the Application_Start event and
store it in the Application object so that the contents is available
to all sessions, what is the best way to remove the contents from
memory when all sessions have ended? Is there any better alternative
to do this? Thanks.
Nikhil


A sidenote: what if new sessions come along after the first batch
ended and the object was removed? They will get a null value from
you Application!
Then again, this might be exactly what you want.

Hans Kesting
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: OsD | last post by:
I'm having trouble with the workflow described bellow: 1. Asp page 1 on server A contains an iframe. 2. Asp page 1 submits a form targeted to the iframe, to Asp page 2 on server B. 3. Asp page...
11
by: Timothy Shih | last post by:
Hi, I am having a freezing issue with my application. My application serves several remotable objects, all of which must be initialized before their use. Furthermore, some of them depend on each...
3
by: Patrick | last post by:
Hi I have the following problem. When starting my asp.net application, i read a encrypted string from a file, decrypt it and want this values to be available in the complete application. they...
3
by: SL | last post by:
All, As I understand it, a single application (i.e. IIS virtual directory) in ASP.NET may in fact have more than one corresponding HttpApplicationState object (more or less one per server...
7
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
9
NeoPa
by: NeoPa | last post by:
In VBA (I expect VB would be similar) controlling another Office Application (Automation) can be done using the following steps : Ensure the Reference (VBA Window / Tools / References) has been...
0
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.