title: VB.NET FileSystemWatcher - Copy created file
body: <p><strong>^^^ That answer is in C#! I am using VB.NET! ^^^</strong></p>
  
  <p>I am using a FileSystemWatcher to monitor a folder for new files.</p>
  
  <p>This sub gets triggered when it detects a change, which should then copy the file to the server.</p>
  
  <pre><code>   Private Sub OnCreated(source As Object, e As FileSystemEventArgs)
          Dim LocalFile As String = e.FullPath
          Dim ServerFile As String = LocalFile.Replace(localSyncPath, serverSyncPath)
  
          Try
              File.Copy(LocalFile, ServerFile)
          Catch ex As Exception
              MessageBox.Show(ex.ToString)
          End Try
  
      End Sub
  </code></pre>
  
  <p>Problem is that this usually pops up an error to say the file is in use. Is there a way to run a loop to keep trying until it works? Or even copy dispite being in use?</p>