Hi,
This is the Simple Code.In this Code I make an infinity loop and match the future time to system time. if condition is true then loop is break.
- while (true)
- {
- try
- {
- long ScheduleDateTime = ConvertToUnixEpoch(Convert.ToDateTime(txtSchedule.Text));
- long datetimesystem = ConvertToUnixEpoch(DateTime.Now);
- if (datetimesystem == ScheduleDateTime)
- {
- SearchBounceBackHistory();
- ExportExcel(txtExportFileName.Text);
- break;
- }
- } catch (Exception ex)
- {
- SearchBounceBackHistory();
- ExportExcel(txtExportFileName.Text);
- }
- }