Link to home
Start Free TrialLog in
Avatar of maralans
maralans

asked on

Copy files

Hi,

I am using the following to copy some files out of one directory to another.  As it is, it copies all the files in the source directory.  Is there a way that I can change this so that it only copies the files *Asl.txt (the Asl filename changes on a daily basis).


        Dim DirSource As String = "C:\NadsMailBox\"
        Dim DirTarget As String = "C:\NadsMailBox\Collect\"
        Dim Directory As New System.IO.DirectoryInfo(DirSource)
        Dim file As System.IO.FileInfo
        For Each file In Directory.GetFiles
            file.CopyTo(DirTarget + file.Name)
        Next

Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maralans
maralans

ASKER

Works just like I wanted.  Thanks for your help.