amkahal
Hi,
i have a problem to restart a thread in vb.net.
suppose i have a function called sendfile() that send file over a socket, first time i click the button the file was sent successfully, the button_click event will call thread1.start(), so when i click then button for the second time, an exception is thrown says that "Thread is running or Terminated; it cannot restart.".
so my goal is to re-use the thread1 that run the fucntion sendfile(), any solutions ?
Ayman
If you are starting a thread and later aborting it there is now way I guess in which you can re-run it thread.abort does not allow you to ru-run it. What you can do is that after you run it and instead of aborting it try to suspend it via thread.suspend. Later you can use thread.run to re-run it again. Hope that helps, good luck :)