DeleteDirectoryOption Enum

Definition

Specifies what should be done when a directory that is to be deleted contains files or directories.

C#
public enum DeleteDirectoryOption
Inheritance
DeleteDirectoryOption

Fields

Name Value Description
ThrowIfDirectoryNonEmpty 4

Throw an IOException if the directory is not empty. The Data property of the exception lists the file(s) that could not be deleted.

DeleteAllContents 5

Delete the contents of the directory along with the directory. Default.

Remarks

This enumeration is used with the DeleteDirectory method.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also