hi,
..i've made a windows service in which i keep watch on a particular directory and whenever a file is Created in that directory i'm running a code to enter the details in the SQLDB...
i've made the event on file Creation but the problem is that whenever the file is created in that directory the FileSystemWatcher.Created event fires twice....with the result that all my code is running twice for the same event and i'm getting duplicated values in my DB
here's the code that i've written in VB.NET
Private Sub fsw_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventA
rgs) Handles fsw.Created
Select Case e.ChangeType
Case IO.WatcherChangeTypes.Crea
ted
ReadFile(e.FullPath)
End Select
End Sub
so whenever a file is created this Sub is running twice...i can't understand why??
any ideas??
thanks in advance..
zulu
Start Free Trial