什么是在Visual Studio中用于App_Data文件夹?是在、文件夹、Studio、Visual

2023-09-02 10:18:03 作者:卡布奇诺

在创建在Visual Studio中新的ASP.NET应用程序中,一对夫妇的文件和文件夹被自动创建。其中一个文件夹称为的App_Data 。

When creating a new ASP.NET application in Visual Studio, a couple of files and folders are created automatically. One of those folders is called App_Data.

此外,通过选择菜单选项发布一个网站时,建设 - >发布复选框可包括从App_Data文件夹中的文件

Also when publishing a website by selecting the menu option Build->Publish a checkbox is available Include files from the App_Data folder.

我是正确的假设把这个文件中的文件和子文件夹都不会被通过网络访问?例如,会是安全的,把该文件夹的资源,我只打算使用由应用code吗?

Am I right assuming that the files put in this file and its sub-folders are not going to be accessible through the web? For example, would it be safe to put in that folder resources that I only intend to be used by the application code?

什么是真正打算使用的的App_Data 文件夹?

What is the real intended use of the App_Data folder?

编辑:

感谢你所有的答案。我是从收到的答案为止主要是在提到两点感兴趣的:

Thank you for all the answers. From the answers received so far I am interested mostly in two points mentioned:

App_Data本质上是基于文件的数据存储 存储点 It不应该是可见的网站,是一个地方的Web应用程序存储和读取 数据 App_Data is essentially a storage point for file-based data store It should not be viewable by the web and is a place for the web app to store and read data from

会有人能够指定的不会被Web可视保证? 我可以依靠这一事实执行标准部署的时候,或者我需要检查服务器上的某些IIS设置以及。

Would someone be able specify how the "not viewable by the web" is ensured? Can I rely on that fact when performing standard deployment, or do I need to check some IIS settings on the server as well.

在这种情况时,我有一组我想只有从应用程序可以访问的PDF文件。请问App_Data文件夹是正确的地方使用,或者我应该创建一个单独的文件夹,并手动设置IIS以确保它不被Web访问?

In the situation when I have a set of pdf files that I want to be accessible only from the application. Would App_Data folder be the right place to use, or should I create a separate folder and manually set IIS to ensure that it is not accessible by Web?

推荐答案

的App_Data基本上是基于文件的数据存储的存储点(而不是一个SQL Server数据库存储为例)。一些简单的网站使用它的内容为XML,例如存储,通常其中对于DB托管费用是昂贵的。

App_Data is essentially a storage point for file-based data stores (as opposed to a SQL server database store for example). Some simple sites make use of it for content stored as XML for example, typically where hosting charges for a DB are expensive.

 
精彩推荐
图片推荐