B4J Question Select a directory

It's a bit of an ambiguous question, can you give an example of where you want to select a directory?
 
Upvote 0
What you want is to select a source directory and a destination directory and move all files from the source to the destination.
 
Upvote 0
If it just one level of directory then you can use something like

Code: Copy
Dim srcDir as String = "C:/temp/someFolder"
Dim destDir as String = "C:/temp/someOtherFolder"  ' this must exist for the copy to work
Dim srcFiles as List = File.ListFiles(srcDir)
For Each f As String In srcFiles
    File.Copy(srcDir, f, destDir, f)
Next

If there are directories within the srcDir you want to copy, then you need to detect if f is a directory (File.IsDirectory(srcDir,f) and code accordingly (eg recursively read the sub directories)
 
Upvote 0
Back
Top