Move a file with File.Move : File Utilities « Stream File « VB.Net Tutorial






Imports System.IO

Public Class Tester
    Public Shared Sub Main
        Dim f As File

        f.Move("test.txt", "text2.txt")
    End Sub

End Class
Unhandled Exception: System.IO.IOException: Cannot create a file when that file already exists.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.__Error.WinIOError()
   at System.IO.File.Move(String sourceFileName, String destFileName)
   at Tester.Main()








13.3.File Utilities
13.3.1.Copy a file
13.3.2.Use the HMACSHA1 hashing function to generate a checksum for a file.
13.3.3.Delete a file with kill
13.3.4.Delete a file
13.3.5.File copyFile copy
13.3.6.Move a File
13.3.7.Move a file with File.Move
13.3.8.Use FreeFile
13.3.9.Use FreeFile to read a text file