[DllImport("userenv.dll", SetLastError=true, CharSet=CharSet.Auto)]
static extern bool GetProfilesDirectory(StringBuilder path, ref int size);
StringBuilder path = new StringBuilder(4*1024);
int size = path.Capacity;
if (GetProfilesDirectory(path, ref size) )
{
... use path value, size contains length...
}