FileInfoReplace Method (String, String) |
Replaces the contents of a specified file with the file described by the current
FileInfo object, 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 FileInfo Replace(
string destinationFileName,
string destinationBackupFileName
)
Public Function Replace (
destinationFileName As String,
destinationBackupFileName As String
) As FileInfo
public:
FileInfo^ Replace(
String^ destinationFileName,
String^ destinationBackupFileName
)
member Replace :
destinationFileName : string *
destinationBackupFileName : string -> FileInfo
Parameters
- destinationFileName
- Type: SystemString
The name of a file to replace with the current file. - destinationBackupFileName
- Type: SystemString
The name of a file with which to create a backup of the file described by the destinationFileName parameter.
Return Value
Type:
FileInfoA
FileInfo object that encapsulates information about the file described by the
destinationFileName parameter.
Remarks
The Replace method replaces the contents of a specified file with the contents of the file described by the current
FileInfo object. It also creates a backup of the file that was replaced. Finally, it returns a new
FileInfo object that describes the overwritten file.
Remarks Pass null to the destinationBackupFileName parameter if you do not want to create a backup of the file being replaced.
See Also