Hi all, I don't know how can I copy files and subdirectories from one directory. Below you can see my code which copies directories but without files into them.
Thanks for your help
' Wywołanie procedury kopiującej katalogi z profilu FF Try Dim source As DirectoryInfo = New DirectoryInfo(profilFF) CopyAllFromProfile(source, target) ' + zapis w logu Catch e As Exception MsgBox(e.ToString, MsgBoxStyle.Critical, "Błąd!") ' + zapis w logu End Try End Sub |
VB.NET:
Public Sub CopyAllFromProfile(ByVal source As DirectoryInfo, ByVal ttarget As DirectoryInfo)
' Kopiujemy katalogi z zawartością z profilu FF
Try
For Each diSourceSubDir As DirectoryInfo In source.GetDirectories()
Dim nextTargetSubDir As DirectoryInfo = ttarget.CreateSubdirectory(diSourceSubDir.Name)
CopyAllFromProfile(diSourceSubDir, nextTargetSubDir)
Next
Catch e As Exception
MsgBox(e.ToString, MsgBoxStyle.Critical, "Błąd!") ' + zapis w logu
End Try
End Sub
Last edited: