gpt4 book ai didi

c++ - GetTempPath 显示与当前不同的用户

转载 作者:行者123 更新时间:2023-11-28 06:34:13 25 4
gpt4 key购买 nike

我在 Windows 8 上使用 MFC。当我得到 Temp 路径时,它包含指向不同用户帐户的路径:

  C:\Users\AACE~1\AppData\Temp

写入文件的权限已关闭,CFile 失败。我的帐户是:

  C:\Users\Dmitry

我在我的帐户下调试和启动应用程序。问题是什么?此外,我在 Windows 8 上运行时只有一个用户帐户。

最佳答案

documentation对于这个函数描述了它是如何工作的:

The GetTempPath function checks for the existence of environment variables in the following order and uses the first path found:

  1. The path specified by the TMP environment variable.
  2. The path specified by the TEMP environment variable.
  3. The path specified by the USERPROFILE environment variable.
  4. The Windows directory.

因此,可能的原因是您的环境配置错误。检查 TMPTEMP 环境变量的值。

关于c++ - GetTempPath 显示与当前不同的用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27018500/

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