0

Possible Duplicate:
Getting the path of the home directory in C#?

I know the method to discover folder like C:\Users\MyLogin\Desktop (Vista) or C:\Documents And Settings\MyLogin\Desktop (XP). But how do I get the path to C:\Users\MyLogin, that is "user home", in .net? I am looking for a generic and safe API call, not "Desktop up one level".

Community
  • 1
  • 1
Konrad Garus
  • 53,145
  • 43
  • 157
  • 230
  • Konrad did you see this link? http://stackoverflow.com/questions/1143706/getting-the-path-of-the-home-directory-in-c – Eric Nov 03 '11 at 16:18

1 Answers1

0

You need to use this:

string userFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Graymatter
  • 6,529
  • 2
  • 30
  • 50