Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

How to copy file using Save Dialogue?

$
0
0
Hello
I have an Access Database at backend of my application.
I have added a backup button to my form.
I have a savedialogue called 'backup'
I know how to copy files in vb.net.
But I don't know how to copy files to the location given by Savedialogue.
What I have is:
Code:

        backup.DefaultExt = "mdb"
        backup.Title = "Save Database as "
        backup.FileName = "Pathare_Gym_Backup_" & Date.Today & ".mdb"
        backup.Filter = "Database file (*.mdb)|*.mdb"
        backup.DefaultExt = "mdb"
        backup.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
        backup.ShowDialog()
        Dim FileToCopy As String
        Dim NewCopy As String
        FileToCopy = "E:\PathareGym\bin\x86\Debug\PathareGym.mdb"
        NewCopy = "" 'path given by savedialogue
        If System.IO.File.Exists(FileToCopy) = True Then
            'System.IO.File.Copy(FileToCopy, NewCopy)
            'MsgBox("File Copied")
        End If


Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>