I'm getting an error with the following code. "Illegal characters in path."
I am trying to watch a certain dir for file (Log files) and when they are
uploaded via ftp move them to another dir. The error occurs on the last
line where I try and copy the files.
Anyone know how to fix this or maybe a better way to do it?
I'm also looking for a way to just check it every.. say 10 minutes.
An unhandled exception of type 'System.ArgumentException' occurred in
mscorlib.dll
Additional information: Illegal characters in path.
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim fsw2 As New FileSystemWatcher("c:\3do") Dim source As String = "c:\3do\*.*" Dim dest As String = "C:\Inetpub\wwwroot\logs" Me.Hide() Dim check As WaitForChangedResult check = fsw2.WaitForChanged(WatcherChangeTypes.Created) If check.ChangeType.Created Then System.IO.File.Copy(source, dest, True) End If End Sub




Reply With Quote