Global.asax.vb中的代码:

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

        Application("user_sessions") = 0

    End Sub

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)

        Application.Lock()

        Application("user_sessions") = Application("user_sessions") + 1

        Application.UnLock()

    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)

         Application.Lock()

        Application("user_sessions") = Application("user_sessions") - 1

        Application.UnLock()

    End Sub

Aspx中的的代码:

        Label1.Text = "本站当前有: <b>" + Application("user_sessions").ToString() + "" + "</b> 位访问者 !"

相关文章:

  • 2021-05-29
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-23
  • 2021-07-11
  • 2021-06-20
  • 2022-02-23
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案