GetProfilesDirectory (userenv)
Last changed: -45.48.65.144

.
Summary
Determines the profiles directory on the current machine. ie c:\Users on Vista and later

C# Signature:

[DllImport("userenv.dll", SetLastError=true, CharSet=CharSet.Auto)]
static extern bool GetProfilesDirectory(StringBuilder path, ref int size);

Sample Code:

   StringBuilder path = new StringBuilder(4*1024);
   int size = path.Capacity;
   if (GetProfilesDirectory(path, ref size) )
   {
       ... use path value, size contains length...
   }

Documentation