Delete Method (Boolean)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Deletes this instance of a DirectoryInfo, specifying whether to delete subdirectories and files.
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public Sub Delete ( _
recursive As Boolean _
)
public void Delete(
bool recursive
)
public:
void Delete(
bool recursive
)
member Delete :
recursive:bool -> unit
public function Delete(
recursive : boolean
)
Parameters
- recursive
Type: System. . :: . .Boolean
true to delete this directory, its subdirectories, and all files; otherwise, false.
Remarks
If the DirectoryInfo has no files or subdirectories, this method deletes the DirectoryInfo even if recursive is false. Attempting to delete a DirectoryInfo that is not empty when recursive is false throws an IOException.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.