Accessing an Existing Instance of an Object in IIS

Accessing an Existing Instance of an Object in IIS

Question:

I have an app exposing a connector class that returns a reference to a single internal global object. This app runs continuously and I want to display status info in an ASP page. When I run code in ASP to do this, it creates a second instance of the EXE. How do I get IIS to use the existing instance?

Answer:

After you create the object the first time, you could place it in the Application Object. The next time you want to access it, retrieve it from the Application object.

Pseudocode:If Application("MyInstance") is Nothing Then   Create the Object   Do what you want with it   Place it in the Application Object    (set Application("MyInstance") = The object)Else   Do what you want with itend if

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved