Need to copy files from one directory to another using System.IO.F


O

OriginalStealth

I have inherited a .net project. The code needs to copy files from a
directory on our shared drive to a users local drive. The code is below. I
need a "for each" statement or some statement that will copy the files from
the shared location to my local drive. Thanks in advance. OS


Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports Microsoft.Win32
Imports System.Configuration.ConfigurationSettings

Namespace Test

Public Class CopyTest
Private asCommandLineArgs As Array
Private sRunAs As String = System.Environment.UserName

Dim SharedDrive As String = "\\mysharedlocation\folder1"
Dim dirs As System.IO.DirectoryInfo() = New
System.IO.DirectoryInfo(path).GetDirectories()
Dim sLocalDrive As String = ""C:\Program
Files\mylocation\folder1"

Public Sub CopyFiles()

System.IO.File.Copy(sSharedDrive & sFileName, sLocalDrive)


End Sub
End Class
End Namespace
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top