Mega Code Archive

 
Categories / VB.Net / File Directory
 

File Replace replaces the contents with the contents of another file

Imports System Imports System.IO Module FileExample     Sub Main()         Try             Dim OriginalFile As String = "test.xml"             Dim FileToReplace As String = "test2.xml"             Dim BackUpOfFileToReplace As String = "test2.xml.bak"             File.Replace(OriginalFile, FileToReplace, BackUpOfFileToReplace, False)         Catch e As Exception             Console.WriteLine(e)         End Try     End Sub End Module