Path::GetTempFileName 方法保存到哪个文件夹?
我需要获取临时文件来查看发生了什么,因为实际文件永远不会输出。但是,我似乎找不到创建临时文件的位置。
我需要在不编写代码或构建应用程序的情况下找到这一点,因为有太多的依赖项分散在各处。我将无法部署调试版本。
I need to get the temp file to see what happened because the actual file is never output. However, I can't seem to find where the temp file is created.
I need to find this out without writing code or building the application because there are too many dependencies scattered all over the place. I would not be able to deploy a debug version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该方法返回临时文件的路径。路径会告诉你它指向哪里。
例如:
在本机上为我生成:
因为 TEMP 环境变量指向 C:\Users\will\AppData\Local\Temp\
但像 GetTempFileName 这样的方法的全部要点是您不必关心文件结束的地方。万一你这样做了,你总是可以使用 %TEMP% 在命令提示符或文件打开对话框中到达那里
That method returns the path of a temporary file. The path will tell you where its pointing.
For example:
produces:
for me on this machine, because the TEMP environment variable is pointing to C:\Users\will\AppData\Local\Temp\
But the whole point of a method like GetTempFileName is that you shouldn't have to care where the file ends up. On the off-chance that you do, you can always get there at command prompts or file-open dialogs by using %TEMP%