There are many .bmp files present in my C:\TEMP directory.
I am using following code to delete all .bmp file in my C:\TEMP directory but somehow its not working as I expect. Can anyone help me in this?
string[] filePaths = Directory.GetFiles(@"c:\TEMP\"); foreach (string filePath in filePaths) { if (filePath.Contains(".bmp")) File.Delete(filePath); } I have already checked that .bmp file and the directory has no read only attribute