Move a Vb.net file

0

I am trying to move a file inside the Server. I have this, but it is not working well at all. You can not find the correct route.

Dim Origen As String = "/images/foto.jpg"
Dim Destino As String = "/images/tarjetas/foto.jpg"
File.Move(Origen, Destino)
    
asked by Abraham Montes 23.05.2018 в 00:23
source

1 answer

0

The error may be that if the destination folder does not exist it may not do so because of existence error ... Try the following that will surely give you results:

On Error Resume Next
Dim Origen As String = "/images/foto.jpg"
Dim Destino As String = "/images/tarjetas/foto.jpg"
MkDir("/images/tarjetas")
File.Move(Origen, Destino)
    
answered by 06.10.2018 в 08:31