X
xzzy
Using ASP.net, C# and a static class, does the following from MSDN mean:
1. a static hashtable would only live during the session and end when the
session ends
2. there would be a different static hashtable for each session
++ from MSDN ++
Static Variables - Lifetime
Extension of Lifetime
If a local variable is declared with the Static keyword, its lifetime is
longer than the execution time of the procedure in which it is declared. If
the procedure is inside a module, the static variable survives as long as
your application continues running.
If a static variable is declared in a procedure inside a class, the
variable's lifetime depends on whether the procedure is shared. If the
procedure is declared with the Shared keyword, the variable's lifetime
continues until your application terminates. If the procedure is nonshared,
its static variables are instance members of the class, and their lifetimes
are the same as that of the class instance.
++ end ++
Thank you,
John
1. a static hashtable would only live during the session and end when the
session ends
2. there would be a different static hashtable for each session
++ from MSDN ++
Static Variables - Lifetime
Extension of Lifetime
If a local variable is declared with the Static keyword, its lifetime is
longer than the execution time of the procedure in which it is declared. If
the procedure is inside a module, the static variable survives as long as
your application continues running.
If a static variable is declared in a procedure inside a class, the
variable's lifetime depends on whether the procedure is shared. If the
procedure is declared with the Shared keyword, the variable's lifetime
continues until your application terminates. If the procedure is nonshared,
its static variables are instance members of the class, and their lifetimes
are the same as that of the class instance.
++ end ++
Thank you,
John