We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
GetProfilesDirectory
GetProfilesDirectory
在 Windows Vista 之前,可以通过 GetProfilesDirectory( )。
在 Windows Vista+ 中,这可以通过 来完成
SHGetKnownFolderIDList()
和SHGetKnownFolderPath()
使用 FOLDERID_UserProfiles KNOWNFOLDERID 常量。Prior to Windows Vista, this can be retrieve via GetProfilesDirectory().
In Windows Vista+, this can be done via the
SHGetKnownFolderIDList()
andSHGetKnownFolderPath()
functions using the FOLDERID_UserProfiles KNOWNFOLDERID constant.获取主路径(%HOMEPATH% 环境变量),然后向上移动一个文件夹(删除用户名)。
Get the home path (%HOMEPATH% environment variable), and then go one folder up (removing the user name).
它可以通过
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
中的ProfilesDirectory
键获得。(请注意,在 Win7(和 Vista?)上,这将是
C:\Users
而不是C:\Documents and Settings
。It's available via the
ProfilesDirectory
key inHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
.(Note that on Win7 (and Vista?) this will be
C:\Users
notC:\Documents and Settings
.