Anatole

Anatole

  • NA
  • 8
  • 13.4k

trying to move file

Jun 29 2010 2:53 PM
Hello,
I'm trying to get Vb.net to move a file selected from an openfiledialog.
This is what I have so far:
 Dim FileToMove As String
        Dim MoveLocation As String

        FileToMove = openFD.FileName

        MoveLocation = folderbrowser.SelectedPath

        If System.IO.File.Exists(FileToMove) = True Then
            System.IO.File.Move(FileToMove, MoveLocation)
            MsgBox("File Moved")
        End If

What I need to do is cut out just the file name from the openFD.FileName from the rest of the path, and attach it to the SelectedPath so I can move the file. What do I need to do?
Thanks,
AW

Answers (4)