Home All Groups Group Topic Archive Search About

Console.ReadLine Abort

Author
8 Feb 2006 1:13 PM
leszek.doniec@googlemail.com
Hello,

Is there any possibility to Abort a thread that is stopped on
Console.ReadLine() call?

Environment.Exit() is not a solution for me, unfortunately.

Thanks in advance for any hints.
Leszek Doniec

Author
9 Feb 2006 12:36 AM
Willy Denoyette [MVP]
Why do you use ReadLine() if you don't expect someone to type anything on
the Keybord? Much better is to let your thread wait on an event, when you
want to terminate that thread you  'Set' the event state to signalled and
your thread can resume or terminate you name it.
Take a look at the WaitHandle class for more details.

Willy.


<leszek.don***@googlemail.com> wrote in message
Show quote
news:1139404419.006685.115720@g14g2000cwa.googlegroups.com...
| Hello,
|
| Is there any possibility to Abort a thread that is stopped on
| Console.ReadLine() call?
|
| Environment.Exit() is not a solution for me, unfortunately.
|
| Thanks in advance for any hints.
| Leszek Doniec
|
Author
9 Feb 2006 12:25 PM
leszek.doniec@googlemail.com
I expect to receive commands from the console. In case of some faults
in other threads I want to stop the thread that is stopped on ReadLine,
without exitting the application.

Is there a  possibility to obtain thread handle (to use API command to
abort the thread)?

Regards,
Leszek

AddThis Social Bookmark Button