访客人数问题 [英] Problem with visitor count

查看:70
本文介绍了访客人数问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道此应用程序的全部功能,但是下面的代码仅显示20次,然后从1开始重新计数.
我应该如何计算总访客数. :-\

I want to know total visters of this application but the following code shows only 20 times then after that the count again starts from 1. What''s wrong with it?
How should I count total visiters. :-\

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
       '' Code that runs on application startup
       Application.Lock()
       Application("tusers") = 0
       Application.UnLock()
   End Sub





Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        '' Code that runs when a new session is started
        Dim tusers As Integer
        Application.Lock()
        tusers = Convert.ToInt32(Application("tusers").ToString)
        Application("tusers") = tusers + 1
        Application.UnLock()
    End Sub




[edit]
1)标题(对于您的问题,请始终使用有意义的名称-您的用户名不会让我们知道您的问题是什么)
2)在代码片段周围使用代码块":它保留格式并使其更易于阅读.
3)语法,标点符号和大写字母(不要全部使用小写字母,它被认为是幼稚的",就像ALL UPPER CASE一样被视为"SHOUTING"
-OriginalGriff [/edit]




[edit]
1) Title (Always use a meaningful name for your question - your username does not us give any idea what your problem is)
2) Use a "code block" around code fragments: It preserves formatting and makes it easier to read.
3) Grammar, punctuation and upper case (Don''t use all lower case, it is considered "childish" like ALL UPPER CASE is considered "SHOUTING"
- OriginalGriff[/edit]

推荐答案

您如何对其进行测试?您的应用程序托管在IIS上吗?是否有可能回收应用程序池?
How did you test it ? Is your application hosted on IIS ? Is there any chance of Application pool recycling ?


这篇关于访客人数问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆