file class : CopyTo(string) method

Description

Copies a file.

Syntax

fileInstance.CopyTo(string path)

Arguments

ClassNameDescription
stringpathPath of a file.

Return value

ClassDescription
fileAn instance that represents a file.

Sample code

1:

file f = new file("c:\somewhere...");

2:

file newFile = f.CopyTo("c:\newpath...");

Notes

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

An exception will be raised if the destination file exists.

Links for reference

Copyright © Cooker All rights reserved.