[Mono-list] How to get user's HOME directory

Piers Haken piersh@friskit.com
Fri, 4 Apr 2003 13:22:48 -0800

> -----Original Message-----
> From: Stefan Saring [mailto:stefan.saring@epost.de]=20
> Sent: Thursday, April 03, 2003 10:54 PM
> To: Marcus
> Cc: mono-list@lists.ximian.com
> Subject: Re: [Mono-list] How to get user's HOME directory
> Yes. On Windows2000 it's e.g. "C:\Documents and=20
> Settings\USERNAME\". This is the place where many=20
> applications store their user settings and profiles (e.g. Mozilla).

This isn't necessarily true. Firstly the directory may not be on the
'C:' drive. Secondly, the string 'Documents and Settings' can be
localized. And thirdly the subdirectory may not be the same as the
username. If for any reason the directory exists (dual-boot,
domain/local) then windows setup will pick a new name. In general, you
shouldn't make assumptions about folder names in the user's profile, you
should use the Environment.SPecialFolder enumeration instead.