gpt4 book ai didi

c++ - 如何在 C++ 中以编程方式解析 %UserProfile% 的位置?

转载 作者:可可西里 更新时间:2023-11-01 13:28:05 25 4
gpt4 key购买 nike

我想在 C++ 中以编程方式查找当前用户配置文件的目录。

最佳答案

SHGetSpecialFolderLocation是获取 Windows 上大多数特殊路径的最佳方式。通过 CSIDL_PROFILE 它应该检索您感兴趣的文件夹。

如果您真的对 %UserProfile% 环境变量的内容感兴趣,您可以试试 ExpandEnvironmentStrings

关于c++ - 如何在 C++ 中以编程方式解析 %UserProfile% 的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2760310/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com