in a C# WPF project : I have a program that receives the file stored in binary form in SQL Server and puts it in a folder in the TEMP path. For example: there is a photo in the database, I select it and writeAllBytes in the temp, then using Process.Start(C:\temp.myiamge.png) I run that photo through the Windows Photo Viewer.
What I need: I don't know how and when I can check to delete the file I wrote in the temp path after closing the Windows Photo Viewer window?
Does anyone have any recommendations?