
Originally Posted by
jmcilhinney
The Copy method you're using will allow you to specify whether or not to overwrite existing files.
no sir, they are ovewriting the file manually in the client side.
So i cant avoid the user to overwrite the file..
So if i validate the difference between the modified time? its a correct process,..Any disavantage in this..
s Code:
Dim sServer As String = "#######\128974_1_En_2_Chapter.xml"
Dim sClient As String = "C:\Enfocus\Deva\128974_1_En_2_Chapter.xml"
If File.Exists(sServer) Then
If File.Exists(sClient) Then File.Delete(sClient)
File.Copy(sServer, sClient)
End If
Dim odDate As DateTime = File.GetLastWriteTime(sClient)
Dim osDate As DateTime = File.GetLastWriteTime(sServer)
'If Date.Compare(osDate, odDate) > 1 Then
If DateDiff(DateInterval.Second, osDate, odDate) > 1 Then
MessageBox.Show("failure-Wrong file")
Else
MessageBox.Show("Success-Right File")
End If