简体   繁体   English

临时 ASP.NET 文件夹中的文件

[英]Stroring files in Temporary ASP.NET folder

I'm working on a legacy .NET project.我正在处理一个遗留的 .NET 项目。 As per the new requirement I'm trying to save the uploaded jpg files for some processing.根据新要求,我正在尝试保存上传的 jpg 文件以进行某些处理。 So I'm getting the executing assembly and create a temporary folder to store images.所以我正在获取执行程序集并创建一个临时文件夹来存储图像。 My question is the ExecutingAssembly returns something like "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\ApplicationName" but still I can store and and process jpg files in that folder.我的问题是 ExecutingAssembly 返回类似“C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\ApplicationName”的内容,但我仍然可以在该文件夹中存储和处理 jpg 文件。 So is it ok to store files in "Temporary ASP.NET" folder .那么可以将文件存储在“Temporary ASP.NET”文件夹中吗 Will it cause any problem?它会引起任何问题吗?

Note: The stored images will be deleted after doing some process and don't need to be retained注意:存储的图片会在做一些处理后被删除,不需要保留

This folder is used to cache the compiled assembly.此文件夹用于缓存已编译的程序集。 When the user requests resources from the website, the web page will be dynamically compiled, and then cached in this folder.当用户向网站请求资源时,网页会被动态编译,然后缓存在这个文件夹中。 When there are subsequent user requests, the resources can be directly obtained from the cache instead Compile again.当有后续用户请求时,可以直接从缓存中获取资源,而不是再次编译。

More information can be found in Understanding ASP.NET Dynamic Compilation更多信息可以在了解 ASP.NET 动态编译中找到

So it can be said with certainty that if the image you want to process does not need to be stored permanently or destroyed after processing, it can be stored in this folder.所以可以肯定地说,如果您要处理的图像不需要永久保存或处理后销毁,则可以将其保存在此文件夹中。 Similarly, the contents of the folder can also be deleted, which will not affect your application, but it needs to be recompiled when users request resources, which may take a little longer.同样,文件夹的内容也可以删除,不会影响你的应用,但是需要在用户请求资源的时候重新编译,时间可能会稍长一些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM