Click or drag to resize

FileCopy(String, String, Boolean) Method

Copies an existing file to a new file where overwrite can be specified.

Namespace: Crestron.SimplSharp.CrestronIO
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public static void Copy(
	string sourceFileName,
	string destFileName,
	bool overwrite
)

Parameters

sourceFileName  String
Source file to copy.
destFileName  String
The name of the destination file.
overwrite  Boolean
'true' if the destination file can be overwritten; otherwise, 'false'.
Exceptions
ExceptionCondition
InvalidDirectoryLocationExceptionInvalid Directory location specified for source or destination.
IOExceptiondestFileName is read-only, or destFileName exists and overwrite is false, or a file system error has occurred.
DirectoryNotFoundExceptionSpecified directory for source or destination does not exist.
PathTooLongExceptionSpecified path for source or destination is greater than 248 characters.
FileNotFoundExceptionThe source file does not exist.
UnauthorizedAccessExceptionSource or destination access is not provided to the user.
ArgumentExceptionsourceFileName or destFileName contain invalid characters.
ArgumentNullExceptionsourceFileName or destFileName is null.
NotSupportedExceptionsourceFileName or destFileName is of invalid format.

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also