I have created a web app version of my previous crawler app and the initial form has controls to allow the client to make selections and start a search 'job'. These searches 'jobs' will be run my different threads created individually and added to a list to keep track of. Now the idea is to have another web form that will display this list of 'jobs' and their current status and will allow the jobs to be cancelled or removed only from the server side. This second form contains a grid to display these jobs. Now I have no idea if I should create the threads in the initial form code or send all user input to my main class which runs the search and if so how do I pass the the thread list to the second form to have it displayed on the grid.
Any ideas really appreciated.
Dim count As Integer = 0
Dim numThread As Integer = 0
Dim jobStartTime As Date
Dim thread = New Thread(AddressOf ResetFormControlValues) 'StartBlogDiscovery)
jobStartTime = Date.Now
thread.Name = "Job" & jobStartTime 'clientName
Session("Job") = "Job" & jobStartTime 'clientName
thread.start()
thread.sleep(50000)
If numThread >= 10 Then
For Each thread In threadlist
thread.Join()
Next
Else
numThread = numThread + 1
SyncLock threadlist
threadlist.Enqueue(thread)
End SyncLock
End If
this is the code that is called when the user clicks the search button on the inital form.
this is what I just thought might work on the second web form if i used the session method.
Try
If Not Page.IsPostBack Then
If Not Session("Job") = Nothing Then
Grid1.DataSource = Session("Job")
Grid1.DataBind()
End If
End If
Finally