Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 31,641 times

Contents

Related Categories

Getting System Folders Easily via API - Introduction

Introduction

So you wrote an application? Great! Commercial? Freeware? Shareware? Awesome! Tested it? Great!

You send your baby on the web to millions of download users and get a ton of mail from users of specific Operating Systems or people that have used Tweaking programs that you get errors.

This is one of the most common errors that may happen to many of you who code in a way which you use static paths.

This can be easily avoided by plugging in a few functions which will do you the job of getting those paths no matter what Win32(and soon Win64) OS is running.

This article explorers the three most common paths which are used by developers:

  1. Windows Directory [Nope its not just c:\windows]
  2. System Directory
  3. Temporary Files Directory

Work Work Work
Currently I'm working at Vividas Pty Ltd and studying at Swinburne University. My time on DeveloperFusion is limited due to workloads on both parts, I do however keep a Blog that gets updated fairly regularly with lots of Techno-babble...

I also have a software business called WebSoftware Systems in Australia, the primary product we have at the moment is HotHTML which started life as a simple VB6 based HTML editor and is now a full blown text/web development IDE. I'm currently also working on the v4.0 release in .NET 2.0.

Comments

  • Temp path... the easy way

    Posted by svdoever on 23 Jul 2005

    When you need the Temp folder, the easy (and clean .Net way) is to use: Path.GetTempPath()

  • Posted by Thushan Fernando on 30 Aug 2003

    it will still work for change dpaths... i used TweakXP to try it out on a few VMs and it worked fine... as far as other languaegs go... i only get English versions of OS's from MS so i dont know what ...

  • Posted by boygenius on 30 Aug 2003

    so if the user changes their dir from say C:\WinNT\System32\ to C:\WindowsNT\System Files\ would i still be able to get the Windows DIR and System DIR?

    also what about foreign languages?

  • Posted by Thushan Fernando on 04 Jul 2002

    hey,

    sorry i couldnt reply earlier, I only saw my post now!

    thank-you for your kind words!

  • VERY USEFUL!

    Posted by MichaelMyAss on 21 Jun 2002

    Hey,

    I must say this is EXTREEMLY useful for a nutcase like myself!

    I infact had the exact problem you said most people have.

    Thanks alot! It really helps!