I am using a background for my sms application.
I have created an application which needs to send messages continously.
When i use background.My application gets hanged i dont know why it is,
my code is
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
//mycode
}
private void backgroundWorker1_RunWorkerCompleted(
object sender, RunWorkerCompletedEventArgs e)
{
backgroundWorker1.CancelAsync();
backgroundWorker1.RunworkAsync();
}
later i have tried this
public void Thread()
{
Thread D = new Thread(BackgroundCode);
D.Start();
}
public void BackgroundCode()
{
for (int i5 = 1; i5 > 0; i5 += 1)
{
//mycode
}
}
this two works fine for 2 or 3 min but after that it gets hang.
Please can anyone please help me.
Thanks In Advance.