Hello,
at the moment I'm not able to finish my program. That means, I have a
problem I can't solve myself. Therefore I'm asking those who already
worked with HttpWebRequest... and threads.
I'm writing some kind of download-manager, which is able to download
several files parallely. Therefore I've created a class implementing the
download function and use four threads which use four instances of the
class. This works fine, except the cancelling of downloads. After a
download-thread has been cancelled, it is not able to download any files
with this thread.
How the program works:
The source for the downloadclass I got from the .net-Documentation and
enhanced in some points.
The download form has arrays for the class-instances, boolvalues
(instance busy or not) and threads (calling StartDownload-function of
classes).
A timer (timWatchTimer) cares for the single threads. If a thread is not
busy anymore (boolvalue bThreadWorking) the next download is started for
this thread (StartNextDownload).
I removed all unnecessary code for a better overview. The sample project
can be found at:
http://vbtricks.vb.funpic.de/vbarchiv/dstest.zip.
The sample has been written using SharpDevelop, but in the subfolder VS
you find a VS-export of the project. The source does have comments but
if there any questions, please don't hesitate to ask them. I'm really up
to solve this problem as I want to finish my program.
Please help me,
Stefan
--
___________________________________www.VBTricks.de .vu
the free resource for Visual Basic, Gambas and Pascal
components, tips & complete projects
www: http://www.VBTricks.de.vu
mail: vbtricks <at> gmx <dot> net
__________________________________________________ ___