Hi!
I have a program with a FileSystemWatcher. Everytime a new file is created in my folder I create a new thread to read him.
Private Sub fSysWatcher_Changed(...) Handles oSysWatcher.Changed
oTh = New Thread(AddressOf ReadFile)
oTh.Name = e.Name
oTh.Start()
end sub
But I have a limit: if there are already 5 thread and a new file is created I want wait the end of one existing thread? How to di it?
Tks!
I have a program with a FileSystemWatcher. Everytime a new file is created in my folder I create a new thread to read him.
Private Sub fSysWatcher_Changed(...) Handles oSysWatcher.Changed
oTh = New Thread(AddressOf ReadFile)
oTh.Name = e.Name
oTh.Start()
end sub
But I have a limit: if there are already 5 thread and a new file is created I want wait the end of one existing thread? How to di it?
Tks!