Click to See Complete Forum and Search --> : Document and settings/<userid> path


AshtangaYogi
May 29th, 2008, 11:15 AM
Hello,

I need to know the best way to get the Documents and settings/<userid> path in C#. I have googled a bit and not found what I need.

Is there a better way that using; System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) and then removing the last directory name?

Thanks

yraen
May 29th, 2008, 01:14 PM
string userFolder = "C:\\Documents and Settings\\" + Environment.UserName;

Provided the folder is the same as their username, it would "work"... Other than that, I couldn't find any builtin function to retrieve exactly what you're looking for.

AshtangaYogi
May 29th, 2008, 01:42 PM
Thank you, at least im not missing anything obvious and your idea was simpler than mine :-)