What folder does the Path :: GetTempFileName method save?

I need to get a temporary file to find out what happened because the actual file is never output. However, I cannot find where the temp file is being created.

I need to find this without writing code or building an application, because too many dependencies are scattered all over the place. I would not be able to deploy the debug version.

+3
source share
1 answer

This method returns the path to the temporary file. The path will show you where to point it.

For instance:

Console.WriteLine(Path.GetTempFileName());

gives:

C:\Users\will\AppData\Local\Temp\tmp9BD5.tmp

for me on this computer, since the TEMP environment variable points to C: \ Users \ will \ AppData \ Local \ Temp \

, GetTempFileName, , , . % TEMP%

+5

Source: https://habr.com/ru/post/1756225/


All Articles