Click or drag to resize

DiskUtilitiesTryCopyDirectory Method (String, String, Boolean, String)

Attempts to copy all the files in a directory from one place to another.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool TryCopyDirectory(
	string sourcePath,
	string targetPath,
	bool alsoCopySubfolders = true,
	string[] excludedFileExtensions = null
)

Parameters

sourcePath
Type: SystemString
The full path to the directory you want to copy
targetPath
Type: SystemString
The full path of the directory you want the files to be in after copying (the directory will be created if it doesn't exist)
alsoCopySubfolders (Optional)
Type: SystemBoolean
Optional parameter to indicate whther or not you want to recursively move all subdirectories. Defaults true.
excludedFileExtensions (Optional)
Type: SystemString
Optional parameter to pass in file extensions that won't be copied. Defaults null.

Return Value

Type: Boolean
True if the copy completes without raising an exception and the source directory exists at the path specified
See Also