Chat etc.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Reflection
|
||||
Imports System.IO
|
||||
|
||||
Public Class Class1
|
||||
|
||||
@@ -819,4 +820,25 @@ Public Class Class1
|
||||
'returnTable = dv.Table
|
||||
Return returnTable
|
||||
End Function
|
||||
|
||||
Public Shared Sub CopyDirectory(ByVal sourcePath As String, ByVal destinationPath As String)
|
||||
Dim sourceDir As DirectoryInfo = New DirectoryInfo(sourcePath)
|
||||
Dim sourceFiles As FileInfo() = sourceDir.GetFiles(sourcePath, "*")
|
||||
For source As Integer = 0 To sourceFiles.Length - 1
|
||||
Dim destinationDir As DirectoryInfo = New DirectoryInfo(destinationPath)
|
||||
Dim destFiles As FileInfo() = destinationDir.GetFiles()
|
||||
For destination As Integer = 0 To destFiles.Length - 1
|
||||
If File.Exists(Path.Combine(destinationPath, sourceFiles(source).Name)) Then
|
||||
If sourceFiles(source).Name = destFiles(destination).Name Then
|
||||
If sourceFiles(source).LastWriteTime > destFiles(destination).LastWriteTime Then
|
||||
sourceFiles(source).CopyTo(Path.Combine(destinationDir.FullName, sourceFiles(source).Name), True)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
sourceFiles(source).CopyTo(Path.Combine(destinationDir.FullName, sourceFiles(source).Name), True)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user