Hello,
  I have a file system watcher looking for a creation of new files then running 
some code to use that file, then deleteing it.
  The first thing I do is copy the file to another location using the File.copy 
method but the entire file does not copy to the second location.   What Am I 
doing wrong here?
   
    Private Sub objWatcher_FileCreated(ByVal FullPath As String) Handles 
objWatcher.FileCreated
  TextBox1.Text &= "File Created: " & FullPath & vbCrLf
  path = "C:\Documents and Settings\Eric\Local Settings\Application 
Data\Identities\{CD27FCB2-9E3C-45F7-BC37-93C84C481291}\Microsoft\Outlook 
Express\Inbox.dbx"
  path2 = "C:\Documents and Settings\Eric\My Documents\Test\filecopy.txt"
  Try
  ' Ensure that the target does not exist.
  File.Delete(path2)
  ' Copy the file.
  File.Copy(path, path2)
  Console.WriteLine("{0} copied to {1}", path, path2)
  ' Try to copy the same file again, which should fail.
  File.Copy(path, path2)
  Console.WriteLine("The second Copy operation succeeded, which was not 
expected.")
  Catch exp As Exception
  Console.WriteLine("The second Copy operation failed, as expected.")
  End Try
  'gatherdata1()
  End Sub
   
   
  Thank-you,
   
  Eric


                        
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to