[Question]File.Move?

Posts 1–7 of 7 · Page 1 of 1
[Question]File.Move?
Is there a way to use file.move to make something like this:

[PHP]File.Move(TextBox1.Text & "\HyperCam2\*name of file*"[/PHP]

But... File.Move, gives errors, and i don't really know how it works. Could someone tell me.. or give me a link to a example?
Code:
Imports System.IO
Public Class Form1

Public Sub Main

        Dim fm As File

        fm.Move("From File Location/File.Extension", "To File Location\file.extension")


    End Sub
End Class
Or

Code:
 Declare Auto Function MoveFile Lib "KERNEL32.dll" Alias "MoveFile" (ByVal src As String, ByVal
dst As String) As Boolean

Public Class Form1

Public sub main
 MoveFile("from file location/file.extension", "to file location/file.extension")

end sub

end class

I think you get the idea
Thanks, i like the first one thou, more organized in my opinion.
Meh it really matters how much you're using the File.Move command.

If you're using it a lot, then use the second code, changing the alias to something shorter.
Code:
System.IO.File.Copy(Starting File Location, Location to move file to)
This is the easy way to do it if you want to preserve the original file
I use this:
Code:
My.Computer.FileSystem.MoveFile("C:\FILE.txt", _
    "C:\File1.txt")
ya the first one is better
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us