Global.asax.cs文件里的内容,

Global.asax.cs文件里的内容,
小弟初学,这个文件里面的东西都分表是做什么的,可以在里面加点什么内容,能干点什么呢?
protected void Application_Start(Object sender,EventArgs e)
{
}
protected void Session_Start(Object sender,EventArgs e)
{
}
protected void Application_BeginRequest(Object sender,EventArgs e)
{
}
protected void Application_EndRequest(Object sender,EventArgs e)
{
}
protected void Application_AuthenticateRequest(Object sender,EventArgs e)
{
}
protected void Application_Error(Object sender,EventArgs e)
{
}
protected void Session_End(Object sender,EventArgs e)
{
}
protected void Application_End(Object sender,EventArgs e)
{
}
深深的凝望 1年前 已收到1个回答 举报

热带沙漠 幼苗

共回答了13个问题采纳率:92.3% 举报

void Application_Start(object sender,EventArgs e)
{
//在应用程序启动时运行的代码
}
void Application_End(object sender,EventArgs e)
{
//在应用程序关闭时运行的代码
}
void Application_Error(object sender,EventArgs e)
{
//在出现未处理的错误时运行的代码
}
void Session_Start(object sender,EventArgs e)
{
//在新会话启动时运行的代码
}
void Session_End(object sender,EventArgs e)
{
//在会话结束时运行的代码.
// 注意:只有在 Web.config 文件中的 sessionstate 模式设置为
// InProc 时,才会引发 Session_End 事件.如果会话模式
//设置为 StateServer 或 SQLServer,则不会引发该事件.
}

1年前

3
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.941 s. - webmaster@yulucn.com