Copies the specified file to a new location.
Type Reason System.Security.Permissions.FileIOPermission Requires permission to read the source file and write the destination file. See System.Security.Permissions.FileIOPermissionAccess.Read and System.Security.Permissions.FileIOPermissionAccess.Write.
Type Reason System.IO.IOException destFileName is read-only (write-protected), or destFileName exists and overwrite is false .
-or-
An I/O error occurred.
ArgumentNullException sourceFileName or destFileName is null. ArgumentException sourceFileName or destFileName is a zero-length string, contains only white space, or contains one or more invalid characters.
-or-
sourceFileName or destFileName specifies a directory.
System.Security.SecurityException The caller does not have the required permission. System.IO.DirectoryNotFoundException Directory information in destFileName or sourceFileName was not found. System.IO.FileNotFoundException sourceFileName was not found. System.IO.PathTooLongException The length or the absolute path information for sourceFileName or destFileName exceeds the system-defined maximum length. UnauthorizedAccessException The caller does not have the required permission.
The sourceFileName and destFileName arguments are permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.Note: To obtain the current working directory, see Directory.GetCurrentDirectory.
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0