How to get APPLICATION DATA directory 
Author Message
 How to get APPLICATION DATA directory

System.IO.Path.GetTempPath gives me the temporary directory for a user.

How do I get the directory for the logged in user that points to:

c:\Documents and Settings\username\Local Settings\Application Data

I want to generate a debug information file and I don't want to put it in
the TEMP directory or the application install directory.

--
Bill McCarthy



Sat, 29 Jan 2005 04:25:48 GMT  
 How to get APPLICATION DATA directory

Quote:

> System.IO.Path.GetTempPath gives me the temporary directory for a user.

> How do I get the directory for the logged in user that points to:

> c:\Documents and Settings\username\Local Settings\Application Data

> I want to generate a debug information file and I don't want to put it in
> the TEMP directory or the application install directory.

This should do the trick:

System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

Tor-Erik



Sat, 29 Jan 2005 04:43:17 GMT  
 How to get APPLICATION DATA directory
If Tor's solution does not work this is how I do it.

I create a module that holds my system public variables (SystemVariables).
Then On the main form load I use the following:

Dim FINFO as new FileInfo(Application.ExecutablePath)
SystemVariables.EXEDIRECTORY = FInfo.DirectoryName

Now I realize that Application.ExecutablePath is doing the work. But I know
I must have needed the FileInfo object for something. I really cant
remember. Any way, hope that helps.


Quote:
> System.IO.Path.GetTempPath gives me the temporary directory for a user.

> How do I get the directory for the logged in user that points to:

> c:\Documents and Settings\username\Local Settings\Application Data

> I want to generate a debug information file and I don't want to put it in
> the TEMP directory or the application install directory.

> --
> Bill McCarthy




Tue, 01 Feb 2005 02:13:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting the application's directory?

2. HELP: Getting application directory from setup

3. Getting data from the Active Directory

4. Access 95 Procedure to link application to multiple data mdb files in same directory

5. Getting ALL directories & sub directories

6. Getting Start Menu Directory and Favorites Directory Paths by API

7. Getting Common Application Data Path

8. Get application directory instead of current directory.

9. Application Directory (Proj Directory)

10. Help - Simply Getting Data from Extrenal Data Files (not from Access Data Base)

11. VB6 Data report - Failed getting Rowset(s) from current data sour ce

12. Getting Meta Data only from ADO Data Control at Design time

 

 
Powered by phpBB® Forum Software