How can I make a variable static (or “global”) in Classic ASP?

前端 未结 2 1214
走了就别回头了
走了就别回头了 2021-01-12 22:55

I want to make my variable static or \"global\" - so the same effect as static in .NET; every session that accesses it gets the same result, and if one session modifies it i

2条回答
  •  Happy的楠姐
    2021-01-12 23:51

    If you want to have a variable that is accessible application wide, you can use the application object. Be sure to use Application.Lock/Unlock to prevent any problems.

    Application.Lock
    Application("MyVariable") = "SomeValue"
    Application.Unlock
    

提交回复
热议问题