Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Application.UserAppDataPath Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David White - 01 Mar 2006 02:34 GMT
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.
Simon Murrell - 01 Mar 2006 08:12 GMT
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.SpecialFolder.ApplicationData)
method. Hope this helps.

Regards,
Simon

> The MSDN docs say, "If a path does not exist, one is created in the following
> format: BasePath\CompanyName\ProductName\ProductVersion". Where does the
[quoted text clipped - 20 lines]
>
> Thanks.
Kevin Spencer - 01 Mar 2006 13:38 GMT
Check out the Environment.SpecialFolder enumeration documentation:

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


Signature

HTH,

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

> The MSDN docs say, "If a path does not exist, one is created in the
> following format: BasePath\CompanyName\ProductName\ProductVersion". Where
[quoted text clipped - 21 lines]
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.