How do I convert this to ASPNET5 web site. I did not find any easy way yet.
The all thing is to handle number of visitors and number members logged-in
<div>GLOBAL.asax.cs
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
base.Application.Add("Visitor", 0);
base.Application.Add("Member", new List<string>());
}</div> <div></div> <div> protected void Session_End(object sender, EventArgs e)
{
base.Application.Lock();
base.Application.Set("Visitor", (int)base.Application["Visitor"] - 1);
((List<string>)base.Application["Member"]).Remove(base.Session.SessionID);
base.Application.UnLock();
}</div> <div></div> <div> protected void Session_Start(object sender, EventArgs e)
{
base.Application.Lock();
base.Application.Set("Visitor", (int)base.Application["Visitor"] + 1);
base.Application.UnLock();
}
ACCOUNTCONTROLLER.cs
public class AccountController
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
{
SignInStatus.Success:
((List<string>)System.Web.HttpContext.Current.Application["Member"]).Add(Session.SessionID);
public ActionResult LogOff()
{
System.Web.HttpContext.Current.Session.Remove(Session.SessionID);
((List<string>)System.Web.HttpContext.Current.Application["Member"]).Remove(Session.SessionID);