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(Di rSource)
Dim file As System.IO.FileInfo
For Each file In Directory.GetFiles
file.CopyTo(DirTarget + file.Name)
Next
Thanks for your help.
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(Di
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER