17-10-12, 12:25 PM
Global.asax
فيها عدة احداث حتما ان اطلعت عليها ستعرفها تلقائيا انظر للملف لدي
وضمن حدث تحميل الصفحة الرئيسية
فيها عدة احداث حتما ان اطلعت عليها ستعرفها تلقائيا انظر للملف لدي
كود :
<%@ Application Language="VB" %>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
Application("activeuser") = 0
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application shutdown
End Sub
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
Session("start") = DateTime.Now
Application.Lock()
Application("activeuser") = Convert.ToInt32(Application("activeuser")) + 1
Application.UnLock()
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a session ends.
' Note: The Session_End event is raised only when the sessionstate mode
' is set to InProc in the Web.config file. If session mode is set to StateServer
' or SQLServer, the event is not raised.
Application.Lock()
Application("activeuser") = Convert.ToInt32(Application("activeuser")) - 1
Application.UnLock()
End Sub
</script>وضمن حدث تحميل الصفحة الرئيسية
كود :
If Not IsPostBack Then Dim i As Integer = Convert.ToInt32(Application("activeuser"))
' Response.Write("عدد الزوار الان: " & i.ToString())
' Application("activeuser") += 1
visit.InnerText = "عدد الزوار الان: " & i.ToString
End Ifاللهم إني أعوذ بك من غلبة الدين وغلبة العدو، اللهم إني أعوذ بك من جهد البلاء ومن درك الشقاء ومن سوء القضاء ومن شماتة الأعداء
اللهم اغفر لي خطيئتي وجهلي، وإسرافي في أمري وما أنت أعلم به مني، اللهم اغفر لي ما قدمت وما أخرت، وما أسررت وما أعلنت وما أنت أعلم به مني، أنت المقدم وأنت المؤخر وأنت على كل شيء قدير

