Click here to Skip to main content
15,916,215 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi All,

I have no experience with Thread, so i appreciate any help ,

I have a Function For Example":

Function Void PrintCount()
{
 For(int i=0;i<100000;i++)
 {
   for(intj=0;j<99999;j++)
   {
     Console.WriteLine(j.tostring());
   }
 }
}


How to stop executing code'The Function'Another Meaning 'forcefully killing the worker Function if it hasn't already completed' Using thread if takes to long ...is it possible that if code is not executed in 10s thread will stop executing it and go to next code...So, Iwant The Code'syntax For 'How To Call This Function inside the Thread',

Thanks in Advance
Posted
Updated 8-May-11 18:04pm
v2

1 solution

Have a look to this article to learn how to use a BackgroundWorker:
BackgroundWorker Class Sample for Beginners[^]

You might also want to use this:
ProgressForm: A simple form linked to a BackgroundWorker[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900