Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
AnswerRe: How would you attack this? Pin
Heath Stewart3-Sep-04 6:43
protectorHeath Stewart3-Sep-04 6:43 
AnswerRe: How would you attack this? Pin
Marc Clifton3-Sep-04 9:51
mvaMarc Clifton3-Sep-04 9:51 
GeneralSetting a stylesheet in AxWebBrowser control Pin
cheesepirate3-Sep-04 3:48
cheesepirate3-Sep-04 3:48 
GeneralRe: Setting a stylesheet in AxWebBrowser control Pin
Nick Parker3-Sep-04 4:51
protectorNick Parker3-Sep-04 4:51 
GeneralRe: Setting a stylesheet in AxWebBrowser control Pin
cheesepirate3-Sep-04 5:17
cheesepirate3-Sep-04 5:17 
GeneralRe: Setting a stylesheet in AxWebBrowser control Pin
Heath Stewart3-Sep-04 6:46
protectorHeath Stewart3-Sep-04 6:46 
GeneralRe: Setting a stylesheet in AxWebBrowser control Pin
Nick Parker3-Sep-04 7:07
protectorNick Parker3-Sep-04 7:07 
GeneralSmtpMail timeout Pin
hkulten3-Sep-04 3:25
hkulten3-Sep-04 3:25 
Hi all!

Here is my problem:

I am developing a Windows service written in C#. The work of this service is to send an alert by mail when the total memory of the OS is too high for example. I'm using the System.Web.Mail namespace to send a mail and everything is ok. I put this piece of code in a thread to make my application more reliable, like that:

' the code for sending mail is in the ThreadLoop method of the Job class
Thread jobThread = new Thread(new ThreadStart(current_job.ThreadLoop));
jobThread.Start();

' wait until the job is done or the timeout is reached
bool noTimeout = current_job.Mre.WaitOne(30*1000, false);

' stop the thread...
jobThread.Abort();


Ok. My problem occured when there is a big file attached to the mail, and the timeout is reached. The method Abort() does not quit the thread until the entire mail is sent...
And I cannot add a timeout to the System.Web.Mail.SmtpMail.Send method, then I am stuck.
Confused | :confused:

Is there a way to force the termination of a thread?


Thanks.

Wink | ;)

QuestionHow to create a dynamic component to include multiple text sections and buttons? Pin
Liquidian3-Sep-04 3:15
Liquidian3-Sep-04 3:15 
AnswerRe: How to create a dynamic component to include multiple text sections and buttons? Pin
Heath Stewart3-Sep-04 6:53
protectorHeath Stewart3-Sep-04 6:53 
GeneralSet method of Expandable property not getting called Pin
pradeep_pc3-Sep-04 2:26
pradeep_pc3-Sep-04 2:26 
GeneralRe: Set method of Expandable property not getting called Pin
Heath Stewart3-Sep-04 6:58
protectorHeath Stewart3-Sep-04 6:58 
GeneralRe: Set method of Expandable property not getting called Pin
Anonymous3-Sep-04 19:44
Anonymous3-Sep-04 19:44 
GeneralDataGrid Cell Color - C# Pin
Jo Develper3-Sep-04 2:15
Jo Develper3-Sep-04 2:15 
GeneralRe: DataGrid Cell Color - C# Pin
sreejith ss nair3-Sep-04 2:37
sreejith ss nair3-Sep-04 2:37 
GeneralRe: DataGrid Cell Color - C# Pin
Jo Develper3-Sep-04 5:17
Jo Develper3-Sep-04 5:17 
GeneralRe: DataGrid Cell Color - C# Pin
Not Active3-Sep-04 5:43
mentorNot Active3-Sep-04 5:43 
GeneralRe: DataGrid Cell Color - C# Pin
Jo Develper5-Sep-04 23:16
Jo Develper5-Sep-04 23:16 
Questioncan not return com from c# Pin
umedkurd3-Sep-04 2:11
umedkurd3-Sep-04 2:11 
AnswerRe: can not return com from c# Pin
Heath Stewart3-Sep-04 7:14
protectorHeath Stewart3-Sep-04 7:14 
GeneralRe: can not return com from c# Pin
umedkurd3-Sep-04 7:51
umedkurd3-Sep-04 7:51 
GeneralRe: can not return com from c# Pin
Heath Stewart3-Sep-04 8:15
protectorHeath Stewart3-Sep-04 8:15 
GeneralRe: can not return com from c# Pin
umedkurd3-Sep-04 18:34
umedkurd3-Sep-04 18:34 
GeneralRe: can not return com from c# Pin
Heath Stewart6-Sep-04 9:10
protectorHeath Stewart6-Sep-04 9:10 
GeneralRe: can not return com from c# Pin
umedkurd7-Sep-04 18:42
umedkurd7-Sep-04 18:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.