如何创建一个临时文件? [英] How to create a temp file?

查看:128
本文介绍了如何创建一个临时文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我是XML和Thread的新手...我想为我的应用程序使用XML文件,例如临时文件.我知道如何打开,写入和保存XML,我的问题是:我希望在单击按钮后打开XML模板文件,然后显示带有许多控件的新表单,并且该文件应保留在内存中,并且控件的价值将被写入其中;我不知道该文件如何保留在内存中并等待写入.另一个问题是,这个打开的XML文件应每40多秒保存到另一个文件夹中.这些怎么做?
PLZ给我一些建议或示例代码!非常感谢!

Hi,everyone! I''m new in XML and Thread...I want to use XML file like a temp file for my application. I know how to open,write and save XML ,what my question is : I want the XML Template file be opened after I click a button, then a new form with many controls show, and this file should stay in memory and the controls'' value will be written in it; I don''t know how this file could stay in memory and wait for writing. Other question is, this open XML file should be saved in another folder in each 40s. How to do these?
PLZ give me some suggestions or example code!Thanks a lot!

推荐答案

由于您未指定,所以我假设您正在谈论Windows窗体应用程序.您创建一个静态对象(很可能是Singleton),该静态对象在应用程序启动时实例化.

"...文件应每40秒钟保存在另一个文件夹中" 40秒钟?请澄清.
Since you didn''t specify I''ll assume you are speaking of a Windows forms application. You create a static object, most likely a Singleton, that is instantiated when the app starts.

"...file should be saved in another folder in each 40s" 40s? Please clarify.


这篇关于如何创建一个临时文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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