是否有任何 API 可以获取路径“C:\Documents and Settings”在窗口中?

发布于 2024-09-05 16:36:08 字数 1539 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

风吹雪碎 2024-09-12 16:36:08

在 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() and SHGetKnownFolderPath() functions using the FOLDERID_UserProfiles KNOWNFOLDERID constant.

最舍不得你 2024-09-12 16:36:08

获取主路径(%HOMEPATH% 环境变量),然后向上移动一个文件夹(删除用户名)。

Get the home path (%HOMEPATH% environment variable), and then go one folder up (removing the user name).

治碍 2024-09-12 16:36:08

它可以通过 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 in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.

(Note that on Win7 (and Vista?) this will be C:\Users not C:\Documents and Settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文