Vi posto la versione Vb.Net
di questa
funzione che ho trovato davvero molto utile:
Public Shared Sub copyDirectory(ByVal Src As String, ByVal Dst As String)
Dim Files() As [String]
If Dst.Chars(Dst.Length - 1) <> Path.DirectorySeparatorChar Then
Dst += Path.DirectorySeparatorChar
End If
If Not Directory.Exists(Dst) Then
Directory.CreateDirectory(Dst)
End If
Files = Directory.GetFileSystemEntries(Src)
Dim Element As String
For Each Element In Files
' Sub directories
If Directory.Exists(Element) Then
copyDirectory(Element, Dst + Path.GetFileName(Element))
' Files in directory
Else
File.Copy(Element, Dst + Path.GetFileName(Element), True)
End If
Next Element
End Sub