Home Cooker Classes Others Rice CookerGX
Classes  >  file  >  CopyTo(string,bool)
file class : CopyTo(string,bool) method

Description

Copy the file to a other file.

Syntax

fileInstance.CopyTo(string copyFileName, bool overWrite)

Arguments

ClassNameDescription
stringcopyFileNamePath of the file that will be copied.
booloverWriteValue that indicates whether overwriting is allowed.

Return value

ClassDescription
filean instance that represent a new file.

Sample code

//anyFile is a instance of file type.

string copyFileName = "path to any file";

anyFile.CopyTo(copyFileName, true);

Notes

It's a wrapper of the System.IO.FileInfo.CopyTo(String,Boolean).

If the second argument is true, overwriting the existing file will be allowed.

If the second argument is false, overwriting the existing file will not be allowed.

Links for reference

Copyright © Rice All rights reserved.