The Application State

One of the most common situations with websites is that you have many people using the website concurrently. If you want to hold shared information across all the application instances, you use the Application state. The following is an example:

Application("SharedKey") = "Shared value"Dim sharedString As String = CStr(Application("SharedKey"))

Notice the key/value semantics and how you need to perform an explicit conversion from Object to String. You will not use Application often because each application instance runs on a separate thread that could modify the information and therefore could corrupt the values, too.

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.