👍 [Help]File Mover

Posts 1–13 of 13 · Page 1 of 1
👍 [Help]File Mover
So, I'm making a program that moves files. But, i have an error.

I can have it select more than 1 file, but now how to make it move more than 1...

AND

Im using a folder browser for the location to be moved, and it needs to to have the file name after it, and if you select more than 1, then it becomes a problem...

Heres my current code:
[php] Dim path As String = TextBox1.Text
Dim destination As String = TextBox2.Text
If File.Exists(path) And Not File.Exists(destination) Then
File.Move(path, destination)
MsgBox("File Moved Successfully", MsgBoxStyle.Information, "Sucess")
Else
MsgBox("The file(s) already exist in the current location.", MsgBoxStyle.Critical, "Error")
End If[/php]

Hmmmm...

Any Help?
whats your error?
Quote Originally Posted by willrulz188 View Post
whats your error?
Uhm... my error is how am I sopposta put it so it will auto put the file names in textbox2, and its only set to move 1 file, not 2+
Quote Originally Posted by Cryptonic View Post
Uhm... my error is how am I sopposta put it so it will auto put the file names in textbox2, and its only set to move 1 file, not 2+
Copy and paste your error or I wont be any help
Ok...



Though, the file doesn't exist...
I get nothing wrong...


try

Code:
        Dim path As String = TextBox1.Text
        Dim destination As String = TextBox2.Text
        If IO.File.Exists(path) And Not IO.File.Exists(destination) Then
            IO.File.Move(path, destination)
            MsgBox("File Moved Successfully", MsgBoxStyle.Information, "Sucess")
        Else
            MsgBox("The file(s) already exist in the current location.", MsgBoxStyle.Critical, "Error")
        End If
Quote Originally Posted by willrulz188 View Post
I get nothing wrong...


try

Code:
        Dim path As String = TextBox1.Text
        Dim destination As String = TextBox2.Text
        If IO.File.Exists(path) And Not IO.File.Exists(destination) Then
            IO.File.Move(path, destination)
            MsgBox("File Moved Successfully", MsgBoxStyle.Information, "Sucess")
        Else
            MsgBox("The file(s) already exist in the current location.", MsgBoxStyle.Critical, "Error")
        End If
Well, first off, I'm trying to make it where you don't have to put the filename in the second textbox. If i put the filename in the textbox, that error wouldn't happen. Which should fix the other errors because if you select more than 1 file, you would have to enter more than 1 filename.. that or it wouldn't work at all...
If i'm understanding you right, just give each file an assigned textbox.
How is your code even readable? O__o Black background ftw?
Quote Originally Posted by master131 View Post
How is your code even readable? O__o Black background ftw?
easier on the eyes
Quote Originally Posted by master131 View Post
How is your code even readable? O__o Black background ftw?
High Contrast. ;D
Alt + Shift + PrtScrn

/offtopic
Quote Originally Posted by Calebb View Post
High Contrast. ;D
Alt + Shift + PrtScrn

/offtopic
Nope Tools>Options>Environments lol
Oops, I posted a solution in your other thread, didn't realize you made another thread /QQ
Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us