how to delete readonly files?

  • Thread starter Thread starter rosty
  • Start date Start date
R

rosty

Directory.Delete() works fine untill there is some read only file. Should I
write a functions that changes all file attributes to FileAttributes.Normal
or is there a better way of doing it?

I just want to be able to delete all files regardless their attribute.

any suggestions?

tia
 
As you don't know if the file are in readonly mode, i suggest you to write a
funcion that will change the attributes of the files : once this is done, you
can call the File.Delete method.

Bye.


Thomas LEBRUN.
 
Back
Top