Using the .net framework you have the option to create temporary files with
Path.GetTempFileName();
The MSDN doesn\'t tell us what happens
They are called temporary because in most cases, the user can assume she can safely clean up the mess in the temp dirs... If not, in general, these files are locked anyway.
In general, these files should be short lived: create them, use them for whatever need you have, delete them on the spot. At worse, delete them when exiting the application.
Sometime, you cannot, eg. an archive manager or a VCS allowing to look at a file with an editor (or diff viewer, etc.), but closed before the editor (or not able to monitor the spawned process...).