Global.asax.cs中的Application_Start无法正常工作

时间:2018-11-06 10:42:52

标签: c# asp.net webforms global-asax

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace SignalRChat
{
    public class Global : HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            if(!File.Exists(Server.MapPath(“Count_Visited.txt”)))
               File.WriteAllText(Server.MapPath(“Count_Visited.txt”),“0″);
            Application["Access"] =int.Parse(File.ReadAllText(Server.MapPath(“Count_Visited.txt”)));
        }
    }
}

但不醒

  

我尝试在Application_Start中设置断点,但是它不起作用

0 个答案:

没有答案