Re: temp directory question
- From: "RobinS" <robins@xxxxxxxxxxxxxxxx>
- Date: Sun, 6 Apr 2008 22:42:52 -0700
This will cause you a problem in Windows Vista if your application is installed in ProgramFiles. A better choice would be to put the file in the local app data, which is under the user's profile -- Environment.SpecialFolder.LocalApplicationData.
RobinS.
GoldMail.com
"kimiraikkonen" <kimiraikkonen85@xxxxxxxxx> wrote in message news:11ccddb0-edb1-4843-8cfc-c62f6b68abd2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 6, 8:13 am, "Aussie Rules" <aus...@xxxxxxxxxx> wrote:
Hi,
In my application I need to write an XML file to disk, but am concerned that
permission might be a problem.
The file only needs to be written out and used for another reason and can
then be deleted.
I was thinking about using the windows/system temp directory as the
location, as I guess that a directory where my application shouldn't have an
issue writting to.
Is this the best location for this file to go? and how do I determine what
the temp directory is ?
Thanks
If you have any difficulty about writing to a specific folder such as
temp (plus you may able to write), create your own temp folder in your
application folder then delete folder / file after operation has
finished.
For example when you need a folder temporarily, create a new one
using:
System.IO.Directory.CreateDirectory("c:\your_app\your_folder")
Then you can delete folder fairly after the directory is not needed
anylonger using:
(usually when formclosing event is fired)
System.IO.Directory.Delete("c:\your_app\your_folder")
Therefore you have a folder that's created and deleted temporarily,
just my opinion.
Regards,
Onur Güzel
.
- Follow-Ups:
- Re: temp directory question
- From: kimiraikkonen
- Re: temp directory question
- References:
- temp directory question
- From: Aussie Rules
- Re: temp directory question
- From: kimiraikkonen
- temp directory question
- Prev by Date: Re: vb2005 - how to create setup/deploy -- no wizard -- VS2005 Pro?
- Next by Date: Re: Basic application design
- Previous by thread: Re: temp directory question
- Next by thread: Re: temp directory question
- Index(es):
Relevant Pages
|
Loading