G
Guest
I am making a windows-service in C#.NET 1.1 (that altso should be possible to
run as an application for testing).
The service shall do some work and sleep between each time the work is done
(the sleep time is set in app.config).
Using Thread.Sleep for pausing the application between each time the work is
done.
To be able to close the application/service anytime while in sleep its
running in its own thread.
Waiting with Abort() to Thread.ThreadState != ThreadState.Running.
This works fine until I use SmtpMail.Send in the thread.
If i do Thread.Abort() on the thread while it is sending a mail the
application stops responding but does not close.
The prosess must be aborted the hard way.
Thread.Join() does not help.
Any suggestion?
run as an application for testing).
The service shall do some work and sleep between each time the work is done
(the sleep time is set in app.config).
Using Thread.Sleep for pausing the application between each time the work is
done.
To be able to close the application/service anytime while in sleep its
running in its own thread.
Waiting with Abort() to Thread.ThreadState != ThreadState.Running.
This works fine until I use SmtpMail.Send in the thread.
If i do Thread.Abort() on the thread while it is sending a mail the
application stops responding but does not close.
The prosess must be aborted the hard way.
Thread.Join() does not help.
Any suggestion?