Possible Duplicate:
C#: Is there a way to check if a file is in use?
I created an app to learn c#. All it does is list the temp directory in a listview and then you click a button to delete the files in that dir but when i do some of the files are in use how can i sift through the files skipping the ones in use while deleting the ones that are not.