Click or drag to resize

FileReplace Method (String, String, String)

Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file.

Namespace:  Alphaleonis.Win32.Filesystem
Assembly:  AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax
public static void Replace(
	string sourceFileName,
	string destinationFileName,
	string destinationBackupFileName
)

Parameters

sourceFileName
Type: SystemString
The name of a file that replaces the file specified by destinationFileName.
destinationFileName
Type: SystemString
The name of the file being replaced.
destinationBackupFileName
Type: SystemString
The name of the backup file.
Remarks
The Replace method replaces the contents of a specified file with the contents of another file. It also creates a backup of the file that was replaced.
Remarks
If the sourceFileName and destinationFileName are on different volumes, this method will raise an exception. If the destinationBackupFileName is on a different volume from the source file, the backup file will be deleted.
Remarks
Pass null to the destinationBackupFileName parameter if you do not want to create a backup of the file being replaced.
See Also