Xceed .NET Libraries Documentation
CopyTo(AbstractFile,Boolean) Method


Xceed.FileSystem Assembly > Xceed.FileSystem Namespace > AbstractFile Class > CopyTo Method : CopyTo(AbstractFile,Boolean) Method
An AbstractFile object that represents the file to which the current file's data must be copied. Cannot be a null reference (Nothing in Visual Basic).
true if the destination file should be replaced if it exists; false otherwise.
Copies the file's data to another file.
Syntax
'Declaration
 
Public Overloads Function CopyTo( _
   ByVal destinationFile As AbstractFile, _
   ByVal replaceIfExists As Boolean _
) As FileSystemItem
'Usage
 
Dim instance As AbstractFile
Dim destinationFile As AbstractFile
Dim replaceIfExists As Boolean
Dim value As FileSystemItem
 
value = instance.CopyTo(destinationFile, replaceIfExists)

Parameters

destinationFile
An AbstractFile object that represents the file to which the current file's data must be copied. Cannot be a null reference (Nothing in Visual Basic).
replaceIfExists
true if the destination file should be replaced if it exists; false otherwise.

Return Value

A reference to a FileSystemItem object that represents the destination file.
Remarks

This method only copies the data of a file to another file.

If the file specified by destinationFile does not exist, it is created. If it does exist, an exception is thrown if replaceIfExists is false, or it is overwritten if replaceIfExists is true.

FileSystemItem.ApplyPropertiesTo is called on the destination item; therefore, the attributes and dates of the original item are applied to the destination item.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AbstractFile Class
AbstractFile Members
Overload List