Click or drag to resize

DiskUtilitiesTryDeleteFilesInDirectory Method (DirectoryInfo, Boolean)

Used to easily clear a directory of its contents.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool TryDeleteFilesInDirectory(
	DirectoryInfo directoryToRemoveFiles,
	bool removeDirectoryFolderAlso = false
)

Parameters

directoryToRemoveFiles
Type: System.IODirectoryInfo
The directory to clear
removeDirectoryFolderAlso (Optional)
Type: SystemBoolean
Delete the directory in addition to all the files inside of it

Return Value

Type: Boolean
True if the deletion is successful, false otherwise
See Also