在Global中 Application_Start 添加
如:
void Application_Start(object sender, EventArgs e)
{
//在应用程序启动时运行的代码
System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
object o = p.GetValue(null, null);
System.Reflection.FieldInfo f = o.GetType().GetField("_dirMonSubdirs", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.IgnoreCase);
object monitor = f.GetValue(o);
System.Reflection.MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
m.Invoke(monitor, new object[] { });
}
- asp.net 删除项目文件/文件夹IIS重启,Session丢失问题
- asp.net基于session实现购物车的方法
- 实现Asp与Asp.Net共享Session的方法
- ASP.NET 使用application与session对象写的简单聊天室程序
- ASP.NET ASHX中获得Session的方法
- ASP.NET中在一般处理程序中使用session的简单介绍
- Asp.Net程序目录下文件夹或文件操作导致Session失效的解决方案
本文由 华域联盟 原创撰写:华域联盟 » ASP.NET 程序中删除文件夹导致session失效问题的解决办法分享
转载请保留出处和原文链接:https://www.cnhackhy.com/53222.htm