ASP.NET 程序中删除文件夹导致session失效问题的解决办法分享
在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[] { });
}
相关文章
Win7安装Visual Studio 2015失败的解决方法
这篇文章主要为大家详细介绍了Win7安装Visual Studio 2015失败的解决方案,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-03-03
"PageMethods未定义"或"对象不支持此属性或方法"解决方法分享
PageMethods未定义或对象不支持此属性或方法解决方法,需要的朋友可以参考下。2010-12-12


最新评论