HighTechTalks DotNet Forums  

Application.UserAppDataPath Question

Dotnet Framework (SDK) microsoft.public.dotnet.framework.sdk


Discuss Application.UserAppDataPath Question in the Dotnet Framework (SDK) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
David White
 
Posts: n/a

Default Application.UserAppDataPath Question - 02-28-2006 , 08:34 PM






The MSDN docs say, "If a path does not exist, one is created in the following
format: BasePath\CompanyName\ProductName\ProductVersion". Where does the
BasePath value come from? It seems the default is "C:\Documents and Settings\
username\Application Data".

But from which of the system environment variables (or elsewhere) is the
BasePath value retrieved? The obvious options seem to be:

%USERPROFILE%

%HOMEDRIVE%%HOMEPATH%

%HOME% (which is set = %USERPROFILE% on my system)

These all resolve to the same location on my system. But for roaming users and
users under Terminal Services, some of these locations can be relocated via
startup scripts somehome (I think) to network locations. So these may all not
always be equal (otherwise why all the different ways to do it?) and I need to
know what changes are picked up by the .Net runtime and passed in.

As an aside - does Application.UserAppDataPath always equal the environment
variable %APPDATA%?

Thanks.

Reply With Quote
  #2  
Old   
Simon Murrell
 
Posts: n/a

Default RE: Application.UserAppDataPath Question - 03-01-2006 , 02:12 AM






Hello David

The BasePath is the AppData environment variable
(e.g. "C:\Documents and Settings\SimonM\Application Data") environment
variable. Hope this helps... You can use the
Environment.GetEnvironmentVariable
method to retrieve the the AppData value (which I presume you already know) as
well as the
Environment.GetFolderPath(Environment.SpecialFolde r.ApplicationData)
method. Hope this helps.

Regards,
Simon

"David White" wrote:

Quote:
The MSDN docs say, "If a path does not exist, one is created in the following
format: BasePath\CompanyName\ProductName\ProductVersion". Where does the
BasePath value come from? It seems the default is "C:\Documents and Settings\
username\Application Data".

But from which of the system environment variables (or elsewhere) is the
BasePath value retrieved? The obvious options seem to be:

%USERPROFILE%

%HOMEDRIVE%%HOMEPATH%

%HOME% (which is set = %USERPROFILE% on my system)

These all resolve to the same location on my system. But for roaming users and
users under Terminal Services, some of these locations can be relocated via
startup scripts somehome (I think) to network locations. So these may all not
always be equal (otherwise why all the different ways to do it?) and I need to
know what changes are picked up by the .Net runtime and passed in.

As an aside - does Application.UserAppDataPath always equal the environment
variable %APPDATA%?

Thanks.


Reply With Quote
  #3  
Old   
Kevin Spencer
 
Posts: n/a

Default Re: Application.UserAppDataPath Question - 03-01-2006 , 07:38 AM



Check out the Environment.SpecialFolder enumeration documentation:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemenvironmentspecialfolderclasstopic.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A brute awe as you,
a Metallic hag entity, eat us.


"David White" <whitedavidp (AT) comcast (DOT) net> wrote

Quote:
The MSDN docs say, "If a path does not exist, one is created in the
following format: BasePath\CompanyName\ProductName\ProductVersion". Where
does the BasePath value come from? It seems the default is "C:\Documents
and Settings\ username\Application Data".

But from which of the system environment variables (or elsewhere) is the
BasePath value retrieved? The obvious options seem to be:

%USERPROFILE%

%HOMEDRIVE%%HOMEPATH%

%HOME% (which is set = %USERPROFILE% on my system)

These all resolve to the same location on my system. But for roaming users
and users under Terminal Services, some of these locations can be
relocated via startup scripts somehome (I think) to network locations. So
these may all not always be equal (otherwise why all the different ways to
do it?) and I need to know what changes are picked up by the .Net runtime
and passed in.

As an aside - does Application.UserAppDataPath always equal the
environment variable %APPDATA%?

Thanks.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.