Hi,
I'm in the need again to manage a temporary folder where parts of our application store documents, e.g. between printing and importing to a dms.
Those files should be deleted on application shutdown and ideally on application start as well, just in case something went wrong.
I just thought of a simple class implementing IDisposable
that can be used inside Main() with a using()-statement, but somehow this feels dirty. Using Directory.Delete(path, true);
inside a catch block that catches all IOException
s didn't really worked reliably in past.
Any opinions on how to implement such a feature the smart way? Any recommendendations?
The actual path to use is not relevant to us, but we do use %AppData%\[Programname]\Temp
now.
Is it possible to create really temporary files on Windows which are deleted on shutdown?
thx for your time.