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

Description

Copy the file to a new file.

Syntax

fileInstance.CopyTo(string copyFileName)

Arguments

ClassNameDescription
stringcopyFileNamePath of the new file.

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);

Notes

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

Please note whether a new file already exists. If it exists, error will occur.

Links for reference

Copyright © Rice All rights reserved.