My application can allow a user to open a file for viewing by fetching
file data from database, creating the file in a temp directory and
starting appropriate process (i.e. Adobe or any other depending of
file type) to open the file.
when I close my application, it is suppose to clean all files it
created in temp directory.
I do this by :
for each file in temp
File.Delete(file)
next
This works fine but if a file is open (say pdf file open by Adobe
process), I can not delete the file with this because the file is used
by Adobe.
How can I determine which process is using the file and kill it in
order to delete the file from temp directory.
I need something like this
for each file in temp
if file is open then
process = get process using this file
kill(process)
end if
delete file
next
Thank you
_dino_