Arctic Midnight
New member
- Joined
- May 5, 2014
- Messages
- 4
- Programming Experience
- 1-3
Hello everyone, I hope I posted this in the right area.
I'm currently working on a simple project, but I've hit a wall.
I'm trying to move files from one location to another. It worked with my.computer.filesystem.copyfile so i thought I could swap that for It worked with my.computer.filesystem.movefile. Turns out I couldn't.
It works flawlessly when i'm copying, but it refuses to do so when I try to move it. It usually throws an exception at me and claims the file already exists in the new directory to move to, which it never is. Any help is much appreciated.
Now, it doesn't work; period. I decided to try and go back to copyfile, and now it refuses to work. It will tell me the directory already exists, as if it's trying to create the directory. I truly have no idea what's going on.
I'm currently working on a simple project, but I've hit a wall.
I'm trying to move files from one location to another. It worked with my.computer.filesystem.copyfile so i thought I could swap that for It worked with my.computer.filesystem.movefile. Turns out I couldn't.
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox1.Checked = True Then
My.Computer.FileSystem.MoveFile(destinationbox.Text, modBox.Text)
End If
If CheckBox1.Checked = False Then
My.Computer.FileSystem.MoveFile(modBox.Text, destinationbox.Text, True)
End If
End Sub
Private Sub selectmod_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selectmod.Click
If (OpenFileDialog1.ShowDialog() = DialogResult.OK) Then
modBox.Text = OpenFileDialog1.FileName
End If
End Sub
Private Sub selectdestination_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selectdestination.Click
If (FolderBrowserDialog1.ShowDialog() = DialogResult.OK) Then
destinationbox.Text = FolderBrowserDialog1.SelectedPath
End If
End Sub
It works flawlessly when i'm copying, but it refuses to do so when I try to move it. It usually throws an exception at me and claims the file already exists in the new directory to move to, which it never is. Any help is much appreciated.
Now, it doesn't work; period. I decided to try and go back to copyfile, and now it refuses to work. It will tell me the directory already exists, as if it's trying to create the directory. I truly have no idea what's going on.
Last edited: