The following is a preliminary model for using a specific procedure to determine the time limit for a row.
Using System;
Using System. Data;
Using System. Threading;
Using System. Windows. forms;
Namespace Win
{
/**/ /// <Summary>
///Run once every 30 minutes
/// </Summary>
Public Class Timer
{
/**/ /// <Summary>Running?</Summary>
Public Bool Brun;
/**/ /// <Summary>Maximum number of outgoing records</Summary>
Public Int Icount = 10 ;
Public Timer ()
{
Brun = False ;
// Used only for outgoing route
Thread mythread = New Thread ( New Threadstart (runtimer ));
Mythread. Start ();
}
/**/ /// <Summary>
///Waiting time and waiting time
/// </Summary>
Private Void Runtimer ()
{
Int Curm = Int32.parse (datetime. Now. Minute. tostring ());
If (Curm = 0 | Curm = 30 ) && ! Brun)
{< br>
Brun = true ;< br>
thread = New thread ( New threadstart (runmethod);
thread. start ();
}
Else
{
If (Curm > 30 )
Curm = 60 - Curm;
Else
Curm = 30 - Curm;
MessageBox. Show (curm. tostring ());
Thread. Sleep (curm * 60 * 1000 );
Runtimer ();
}
}
/**/ /// <Summary>
///Time-based row Creation Method
/// </Summary>
Private Void Runmethod ()
{
Int Irun = 0 ;
Try
{
MessageBox. Show (datetime. Now. tostring ());
Brun= False;
Runtimer ();
}
Catch
{
If(Irun<Icount) runmethod ();
ElseMessageBox. Show ("System FAQs");
}
Finally
{
Irun++;
}
}
}
}