从服务器删除Directry它删除asp.net 3.5中的所有会话 [英] Delete the Directry from server it remove all the session in asp.net 3.5

查看:72
本文介绍了从服务器删除Directry它删除asp.net 3.5中的所有会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用asp.net 3.5制作应用程序。此应用程序有一个页面,从服务器中删除该文件夹。但是当我通过这个页面删除文件夹时,它会删除所有会话。





I make a application with asp.net 3.5. this application has a page which delete the folder from server. but when i delete the folder through this page than it remove all the session.


string path_to_map = "~/Administrator/folder";
Directory.Delete(Server.MapPath(path_to_map), true);





请帮我解决这个问题。



Thanx有问候

Ankush Sharma



please help me for solve this problem.

Thanx with Regards
Ankush Sharma

推荐答案

因为当您删除应用程序的子目录时,应用程序域将重新循环并丢失会话。您的会话状态模式必须是InProc。您应该切换到StateServer或SQLServer。另一种方法是创建一个虚拟目录并从中删除文件夹,而不是从实际文件夹中删除。
Because when you delete a subdirectory of your application, the application domain recycles and you lose the session. Your session state mode must be InProc. You should switch to StateServer or SQLServer. Another way is to create a virtual directory and delete folders from it not from your actual folder.


这篇关于从服务器删除Directry它删除asp.net 3.5中的所有会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆