Click here to Skip to main content
14,303,133 members
Rate this:
Please Sign up or sign in to vote.
See more:
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) 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]
Posted
Updated 13-Sep-10 1:23am
v4
Comments
Kunal Chowdhury «IN» 13-Sep-10 6:45am
   
"venubabu k" Is it a Question or your name? Put a proper question as the Subject line, so that, one can understand it.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

How did you test it ? Is your application hosted on IIS ? Is there any chance of Application pool recycling ?
   
Comments
venubabu k 13-Sep-10 7:45am
   
No need IIS We can count how many times Application loaded.any how i Found solution.
thanking you.
Abhijit Jana 13-Sep-10 10:03am
   
"No need IIS We can count how many times Application loaded" . That I know. I was just asking, if there is any with IIS recycling .
Thanks !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100