Delete a directory and all it's sub drectories if recursive and deleteSubDirectories recursive
true. If recursive is true but deleteSubDirectories, only the file in the subdirectories are deleted.
Namespace:
Devolutions.UtilsAssembly: Devolutions.Utils (in Devolutions.Utils.dll)
Syntax
| Visual Basic |
|---|
Public Shared Function DeleteDirectory ( _ path As String, _ deleteStartingDirectory As Boolean, _ recursive As Boolean, _ deleteSubDirectories As Boolean, _ throwError As Boolean, _ excludingFiles As String(), _ includingFiles As String() _ ) As Boolean |
| C# |
|---|
public static bool DeleteDirectory( string path, bool deleteStartingDirectory, bool recursive, bool deleteSubDirectories, bool throwError, string[] excludingFiles, string[] includingFiles ) |
Parameters
- path
- Type: System..::..String
Path to delete
- deleteStartingDirectory
- Type: System..::..Boolean
Indicate if the starting directory must be deleted.
- recursive
- Type: System..::..Boolean
Indicate if the delete must be recursive or not.
- deleteSubDirectories
- Type: System..::..Boolean
Indicate if the the folder in the subdirectory must be deleted.
- throwError
- Type: System..::..Boolean
If throwError is false, error will not be raised and the process will continue.
- excludingFiles
- Type: array<System..::..String>[]()[][]
Mask of excluded files.
- includingFiles
- Type: array<System..::..String>[]()[][]
Mask of included files.