Question Win Form App Initialisation question

ballybeg

Member
Joined
Jul 28, 2011
Messages
20
Location
Canberra Australia
Programming Experience
10+
I have a question that regarding the initialisation and setup at the daily startup of a winform app.

The startup requires a httprequest to login to a remote website, to obtain a cookie container for later processing. It uses the Keep Alive method to stay open as long as the sub is open.

My question is (perhaps naiive?) how can I keep the cookie container, and any other variables stored in memory kept there so they stay in scope while I the application is doing other things throughout the day?

For example, I have a sub in a class that takes care of the login to the web site and stores the cookies, once the sub ends, the cookie jar empties out. I could keep loging in again but that seems like extra processing to call the process instead of jsut keeping it in memory. I guess I could write the cookies out to a table and read back in, but perhaps there is simpler way?

ballybeg
 
Assign the data to properties of an object that exists for the life of the application, e.g. one assigned to a member variable of your main form, or else assign them to Shared properties of a class or properties of a module so no actual object is required.
 
Back
Top