English 中文(简体)
将文件保留在用户临时文件夹中是可以接受的吗?
原标题:Is it acceptable to leave files in user temp folder?

我正在开发一个程序,生成一组位图,然后将它们装入一个表格,供用户取用。

位图来自用户可以添加的小矢量库。 代码现在创建文件, 然后在使用后立即删除, 只需在下次用户打开 UI 时再生成它们( 使 UI 需要几秒钟来装入) 。

我想知道的是,将我的位图“永远”留在用户临时文件夹中,如果它们不在文件夹中,可以重新生成吗?由于可能的许可问题,我不能指望能够在应用程序目录中存储这些图像,正如我所说,我不能预先配置文件,因为用户可以添加更多。

最佳回答

理想情况下,您应该将任何临时数据生成到记录和档案管理系统,而不是文件系统。

如果您能确保您的应用程序只存储每个用户的有限数量的此类文件, 取决于临时文件是可以接受的。 任何临时文件都可以留在意外碰撞/ 断电时, 不论代码做什么。 因此, 您需要实施一个机制, 来删除上一个会话中由同一应用程序创建的任何破旧文件, 可能是在下次启动时 。

假设这种安全机制,当申请出境听起来像一个非标准但合理的“缓冲”时,故意留下临时档案。

Caveat : 您应用程序的下一个版本可能需要略微不同的文件格式, 并且应该根据一些简单的版本方案, 以不匹配的格式检测、 删除和再生任何文件, 以避免交叉构建依赖性 。

问题回答

暂无回答




相关问题
How to start to create an application GUI using C#?

HI! I am new to C# and plan to use it for my application GUI. I am trying to make my GUI similar to SPSS:http://www.spss.com/images/08/statistics_screens/ez_rfm-big.jpg Is this easy in C#? Is there ...

Automatic height of edit box

My shoes application has three items stacked on top of each other (with a stack, of course), in order: A banner An edit box Two buttons in a flow What I want to do is have the banner stay at it s ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

UI And TcpClient Issue in vb.net

I m having some problems with a small ircbot i m writing. Basically I connect to the server using a tcpclient in a seperate class, which also runs on its own thread. I want to display the server text ...

UI Convention: Shortcut key for application exit? [closed]

Is there a convention for the shortcut keys for application exit? Some applications uses Alt+X some others use Ctrl+ X and Ctrl+Q. Applications like FF and IE doesnot assign a shortcut at all. So is ...

热门标签