您的位置:首页 > 编程语言 > ASP

ASP.NET 程序中删除文件夹导致session失效问题的解决办法分享

2013-12-31 15:46 851 查看

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 session失效