ASP.NET C# Application Object Getters and Setters
- by kellax
I have had a hard time finiding a newbie friendly example of accessing Application Object. I have few things ( arrays ) i would like to store in Application Object to keep as persistant data for about 2h till AppRecycle
Anyhow i know how to set an Application Object variable this way:
// One way
String[] users = new String[1000];
Application["users"] = users;
// Another way
Application.Add("users", users);
However i do not know how to access these variables once in Application Object there is a Getter method Get however it requires int index and other one Contents which get's everything.
Here i try to retrive my String[] array but gives me a error that i am trying to convert Object to String.
String[] usersTable = Application["users"];
// Since this is an object i also tried Application.users but gives error