Results 1 to 3 of 3

Thread: [RESOLVED] folder to store application's temporary updated files

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    Resolved [RESOLVED] folder to store application's temporary updated files

    Hello,

    I have created an updater for our clients application. The way the updater works is to download all the updated files and store them in a temporary folder then check the file hashes. If everything is ok it will copy the files to the applications installation folder. Once this is been completed it will delete all the updated files in the temporary directory.

    My problem: I am looking for a directory that will be available for XP, Vista, and Win7. I was thinking about the 'temp' directory. However, when I do this:

    Code:
    Environment.SpecialFolder.
    There is no enum for temp directory. What would be the next best thing to store these temporary files?

    Many thanks for any advice,
    steve

  2. #2
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: folder to store application's temporary updated files

    You can expand the value of the Special Folders...
    vb.net Code:
    1. Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

    But you can get the Temp directory with this:
    vb.net Code:
    1. IO.Path.GetTempPath()
    2. 'or
    3. Environment.ExpandEnvironmentVariables("%temp%")
    Last edited by mickey_pt; Aug 18th, 2009 at 06:49 AM. Reason: Forogot to post the code...

    Rate People That Helped You
    Mark Thread Resolved When Resolved

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: folder to store application's temporary updated files

    You can also use My.Computer.FileSystem.SpecialDirectories.Temp
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width