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.
[TABLE="width: 90%, align: center"]
[TR]
[TD]' 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[/TD]
[/TR]
[TR]
[TD="class: code, bgcolor: #0A0A0A"][/TD]
[/TR]
[/TABLE]
Thanks for your help 
[TABLE="width: 90%, align: center"]
[TR]
[TD]' 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[/TD]
[/TR]
[TR]
[TD="class: code, bgcolor: #0A0A0A"][/TD]
[/TR]
[/TABLE]
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: