How to copy an existing file to a new file and allow overwritten in VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Dim new_file_name As String = "d:\\data_copy.txt"

        File.Copy("d:\\data.txt", new_file_name, True)

        Console.WriteLine(File.ReadAllText("d:\data.txt"))
        Console.WriteLine(File.ReadAllText(new_file_name))

    End Sub

End Module

' run:
' 

' C++
' VB.NET
' C#
' Java
' PHP

' C++
' VB.NET
' C#
' Java
' PHP

 



answered Sep 30, 2018 by avibootz

Related questions

...