阅读背景:

为什么我可以使用FileInfo删除.NET中的打开图像文件?

来源:互联网 

I have a small utility that deletes files from folders using .NET's FileInfo.Delete() method. Basically, I can catch an IOException if the file is currently open. This works for all files except for image files (JPG, GIF, BMP, ect.). When these types of files are open, the program is still able to delete them without throwing any exception. Have you encountered this before? How would go about detecting that these types of files are open so that I can prevent the deletion.I have a small utility that deletes files from




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: