Programalama > ASP


Ort. 0
Puan ver:
<Object Runat="Server" Scope="application" ID="dOnlineUsers" ProgID="Scripting.Dictionary"></Object>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
sub Application_OnStart
    application("ServerStart") = now
end sub
function Decrypt(sText)
    Decrypt = sText
end function    

function adZero(sText)
    if isNull(sText) then exit function
    adZero = string(5 - len(sText), "0") & sText
end function

Sub Session_OnStart


    Session.TimeOut = 5
    sAktifUsrList = application("AktifUsrList")
    
    sNewUserName = Decrypt(request.cookies("isim")+ request.cookies("soyisim"))
    
    if sNewUserName = "" then sNewUserName = "Ziyaretci-" & AdZero(CInt(application("Ziyaretci")))
    
    sLastActionTime = Time
    
    sUserInfo = sNewUserName & "<|>" & sLastActionTime & "<|>" & sLastPageViewed


    dOnlineUsers.Add Session.SessionID, sUserInfo
    
    application.lock
    application("AktifUsr") = application("AktifUsr") + 1
    application("Ziyaretci") = application("Ziyaretci") + 1
    
    if application("TodaysDate") <> Date() then
        application("PageViewsToday") = 0
        application("ZiyaretciToday") = 0
    end if
    application("ZiyaretciToday") = application("ZiyaretciToday") + 1
    application("TodaysDate") = Date()
    application.unlock
    
End Sub

Sub Session_OnEnd

    on error resume next
    dOnlineUsers.Remove Session.SessionID
   
    application.lock
    application("AktifUsr") = application("AktifUsr") - 1
    application.unlock

End Sub
</SCRIPT>


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2019 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.