public static GetUserProfileDir ( IntPtr hToken ) : string | ||
hToken | IntPtr | |
return | string |
public static string GetUserProfileDir(IntPtr hToken)
{
string ret = "";
StringBuilder path = new StringBuilder(260);
uint path_size = Convert.ToUInt32(path.Capacity);
if (SafeNativeMethods.GetUserProfileDirectory(hToken, path, ref path_size))
{
ret = path.ToString();
}
else
{
LibraryLogging.Error("GetUserProfileDirectory error:{0}", LastError());
}
return ret;
}