Results 1 to 11 of 11

Thread: file manipulation.

Threaded View

  1. #3

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: file manipulation.

    Quote Originally Posted by jmcilhinney View Post
    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:
    1. Dim sServer As String = "#######\128974_1_En_2_Chapter.xml"
    2.         Dim sClient As String = "C:\Enfocus\Deva\128974_1_En_2_Chapter.xml"
    3.         If File.Exists(sServer) Then
    4.             If File.Exists(sClient) Then File.Delete(sClient)
    5.  
    6.             File.Copy(sServer, sClient)
    7.         End If
    8.         Dim odDate As DateTime = File.GetLastWriteTime(sClient)
    9.         Dim osDate As DateTime = File.GetLastWriteTime(sServer)
    10.  
    11.         'If Date.Compare(osDate, odDate) > 1 Then
    12.         If DateDiff(DateInterval.Second, osDate, odDate)  > 1 Then
    13.             MessageBox.Show("failure-Wrong file")
    14.  
    15.         Else
    16.             MessageBox.Show("Success-Right File")
    17.         End If
    Last edited by vijy; Mar 18th, 2009 at 03:58 AM.
    Visual Studio.net 2010
    If this post is useful, rate it


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width