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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top