ASP.NET会话和放大器;删除文件夹 [英] ASP.NET Session & Delete Folders

查看:108
本文介绍了ASP.NET会话和放大器;删除文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个web应用程序,管理员可以创建消息,PDF文档和其他的东西在他的CMS面板。

I have a web app where the administrator can create news, pdf documents and other stuff in his cms panel.

问题是,当管理员删除一个新的或别的应用程序删除所有涉及到新的,我指的是图像,PDF等文件的文件。塔的主要问题是这些文件都存储在文件夹中的新闻文件夹下,当应用程序删除它们的会话丢失。

The problem is when the admin delete a new or something else the app deletes all the files related to that new, I mean the images, pdfs and other documents. Tha main problem is those files are stored in folders under the "news" folder and when the app deletes them the session is lost.

我该怎么做才能有一个文件系统,而不会丢失会话?
我想在app文件夹内的文件系统...

How can I do to have a file system without losing the session? I'd like that file system within the app folder...

我们不可能来存储应用之外的文件夹,我们不希望使用,因为performanne的的StateServer ....

Impossible for us to store those folders outside the app and we don't want to use StateServer because of the performanne....

任何其他解决办法?

感谢

推荐答案

您会话丢失becasue IIS重新编译。在我看来,最简单的解决方法是将文件存储wwwroot文件之外。

Your session is lost becasue IIS recompiles. The easiest solution in my opinion is to store your files outside the wwwroot.

讨论了SO:时创建,重命名或删除文件夹 ASP.NET重新启动

Discussed on SO: ASP.NET restarts when a folder is created, renamed or deleted

[更新]
例:
让我们留在你的应用程序是在C:\\的Inetpub \\ wwwoot \\ virtualdir1

[Update] Example: Let's stay your app is in c:\inetpub\wwwoot\virtualdir1

您做一个工作目录:
C:\\的Inetpub \\百宝箱 - 生活查询

You make a work directory: c:\inetpub\inetwork

给适当的权限(读/写/等)到你的应用程序池的Asp.net用户,它应该像一个魅力一切工作。
关于设置权限更多信息:<一href=\"http://stackoverflow.com/questions/5729264/what-are-all-the-user-accounts-for-iis-asp-net-and-how-do-they-differ\">What是所有用户帐户为IIS / ASP.NET,他们如何不同?

Give the proper rights (read/write/etc) to the Asp.net user of your app pool and it should all work like a charm. More info on setting the rights: What are all the user accounts for IIS/ASP.NET and how do they differ?

存储在您的web.config的路径workdirectory(你没有不想硬code吧)

Store the path to the workdirectory in your web.config (you no not want to hardcode it)

这篇关于ASP.NET会话和放大器;删除文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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