什么是在Visual Studio中用于App_Data文件夹? [英] What is the App_Data folder used for in Visual Studio?

查看:698
本文介绍了什么是在Visual Studio中用于App_Data文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建在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:

  1. <一个href="http://stackoverflow.com/questions/528858/what-is-the-appdata-folder-used-for-in-visual-studio/528876#528876">App_Data本质上是基于文件的数据存储
  2. 存储点
  3. <一个href="http://stackoverflow.com/questions/528858/what-is-the-appdata-folder-used-for-in-visual-studio/528872#528872">It不应该是可见的网站,是一个地方的Web应用程序存储和读取
  4. 数据
  1. App_Data is essentially a storage point for file-based data store
  2. 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.

这篇关于什么是在Visual Studio中用于App_Data文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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