Results 1 to 11 of 11

Thread: Resolved - copying & over riding file

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2012
    Posts
    80

    Resolved - copying & over riding file

    Hi Guys,

    I have code that copies from path folder and then copies it over to the destination folder when button is clicked.

    problem is it won't overide if there is bin file in that directory allready.

    how can I over come this problem?

    HTML Code:
    Imports System.IO
    
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            
                Dim path As String = "c:\toolbox\nandpro\nand1.bin"
                Dim destination As String = "c:\toolbox\360multi\data\my360\nanddump.bin"
            If IO.File.Exists(path) And Not File.Exists(destination) Then
                IO.File.Copy(path, destination)
                Label1.Text = "File Copied Successfully"
            Else
                Label1.Text = "There is already a file called test.txt in the Destination Folder"
    
            End If
    End Sub
    
    End Class
    Last edited by VbAzza; Feb 6th, 2012 at 08:45 AM. Reason: resloved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width