The idea is that you call QueueUserWorkItem once for each work item. How many work items have you got? 255, right? So you call QueueUserWorkItem 255 times:In SomeMethod you get the value of i, make an IP address out of it and ping it. That is all you do. The system handles the rest.vb.net Code:
For i = 1 To 255 ThreadPool.QueueUserWorkItem(AddressOf SomeMethod, i) Next




Reply With Quote