源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-01-13 01:14 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP.NET 程序中删除文件夹导致session失效问题的解决办法分享
在Global中  Application_Start 添加 如:
[u]复制代码[/u] 代码如下:
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[] { });     }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部