Directory. Delete Method (String, Boolean) (System. IO)Deletes the specified directory and, if indicated, any subdirectories and files in the directory. Namespace. System. IOAssembly. Â mscorlib (in mscorlib. Delete(. bool recursive. How do I delete a read-only. and System.IO.FileInfo.Delete will not delete a read-only file. I don't care about protecting files in this particular directory. How do I delete a read-only directory (other than executing attrib)? Is there a way to change the attributes on directories, like there is for files? Path is a directory.-or- path specified a read-only file. (copyError.Message); } } // Delete source files that were copied. foreach. { File.Delete(f). . any subdirectories and files in the directory. The directory contains a read-only file. } Directory.Delete (topPath. IO.Directory.Delete(strFolderName, True). I have the same issue with C#.NET2.0. system and read-only files. File.Delete. Deleting files is not always possible. Sometimes documents are locked or unavailable. File.Delete throws an exception if this occurs.
. Delete folder, including its sub-folders and. if we there is one or more files marked as read-only inside the. using the method Directory.Delete.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2016
Categories |