Last post Sep 29, 2011 03:35 AM by Dave Sussman
Sep 28, 2011 07:34 PM|robertc|LINK
I followed an article written in C# and have tried to convert it to vb.net
I'm simply trying to store a userID and userName within a dictionary object that gets updated each time a user logs in, or out, or the session ends.
I've created a class that contains a shared variable. My only problem is that every time I try to access this variable I get an
Here is the code to the class i'm using.
' Note: This class has no constructor
Public Class MyStaticClass
Shared myGlobalVar As IDictionary(Of Int32, String)
Shared applock As New Object()
''' Get and Set using the application state property.
Public Shared Property OnlineUsers() As IDictionary(Of Int32, String)
Set(value As IDictionary(Of Int32, String))
myGlobalVar = value
Here is how i'm calling this;
Thanks in advance
Sep 29, 2011 03:35 AM|Dave Sussman|LINK
You haven't actually created an instance of the dictionary. try:
Shared myGlobalVar As New Dictionary(Of Int32, String)