- Private Sub CopyDir(ByVal srcPath As String, ByVal aimPath As String)
-
- Try
-
-
-
- If aimPath.Substring(aimPath.Length - 1) <> Path.DirectorySeparatorChar Then
-
- aimPath += Path.DirectorySeparatorChar
-
- End If
-
-
-
-
- If (Not Directory.Exists(srcPath)) Then Exit Sub
-
-
-
-
-
-
-
-
-
- Dim fileList() As String = Directory.GetFileSystemEntries(srcPath)
-
-
-
-
- For Each FileName As String In fileList
-
-
-
- If Directory.Exists(FileName) Then
-
- If (Not Directory.Exists(aimPath + Path.GetFileName(FileName))) Then Directory.CreateDirectory(aimPath + Path.GetFileName(FileName))
-
- CopyDir(FileName, aimPath + Path.GetFileName(FileName))
-
-
-
- Else
-
- File.Copy(FileName, aimPath + Path.GetFileName(FileName), True)
-
- End If
-
- Next
-
-
- Catch ex As Exception
-
- Response.Write("<br>" + ex.ToString())
-
- End Try
-
- End Sub