Re: temp directory question
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Mon, 7 Apr 2008 12:44:00 +0200
Kimi,
Just the simple way as Herfried wrote is in my idea the solution here.
Cor
"kimiraikkonen" <kimiraikkonen85@xxxxxxxxx> schreef in bericht
news:26930928-77a6-4de6-b926-51b59a27753d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 7, 8:42 am, "RobinS" <rob...@xxxxxxxxxxxxxxxx> wrote:
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" <kimiraikkone...@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
I'm not familiar with Vista at the moment so i don't know what you
meant about what it causes, but you must be able to create and delete
your own folders with no problem in XP and olders in program files.
Maybe program files is protected in Vista. Thanks for the info.
But with same logic you can dynamically create / delete a folder in a
writable location such as you mentioned.
.
- References:
- temp directory question
- From: Aussie Rules
- Re: temp directory question
- From: kimiraikkonen
- Re: temp directory question
- From: RobinS
- Re: temp directory question
- From: kimiraikkonen
- temp directory question
- Prev by Date: Re: Heavy Application with Multiple Modules
- Next by Date: Re: Need to wait for TableAdapter.Update to finish
- Previous by thread: Re: temp directory question
- Next by thread: Re: temp directory question
- Index(es):
Relevant Pages
|