///////////////////////////////////////////////////////////// public Form1() { InitializeComponent(); ////////////////////////////////////////////////////task sceduler _scheduler = new scheduler(); dateTimePickerStartDate.Value = DateTime.Today; dateTimePickerEndDate.Value = DateTime.Today.AddYears(1); ///////////////////////////////////////////////////// try { //Icon = SnmpApp.Properties.Resources.ajax_loader__3_; btn_fcontent.Enabled = false; btn_chk_resume.Enabled = false; btn_chk_start.Enabled = false; btn_chk_stop.Enabled = false; path_p = string.Copy(appPath + "\\Currently_Pinging.txt"); path_np = string.Copy(appPath + "\\Currently_nPinging.txt"); System.IO.StreamWriter file1 = new System.IO.StreamWriter(path_p); file1.Close(); System.IO.StreamWriter file2 = new System.IO.StreamWriter(path_np); file2.Close(); } catch (Exception ex) { MessageBox.Show("Problem in Temporary File creation: Exit and Try to Restart the Application"); } }
void triggerItem_OnTrigger(object sender, scheduler.OnTriggerEventArgs e) { textBoxEvents.AppendText(e.TriggerDate.ToString() + ": " + e.Item.Tag + ", next trigger: "+e.Item.GetNextTriggerTime().DayOfWeek.ToString()+", " + e.Item.GetNextTriggerTime().ToString()+"\r\n"); UpdateTaskList(); if (comboBox6.SelectedItem == "1 Sec") { gapsec = 1; } else { if (comboBox6.SelectedItem == "5 Sec") { gapsec = 5; } else { if (comboBox6.SelectedItem == "30 Sec") { gapsec = 30; } else { if (comboBox6.SelectedItem == "5 Min") { gapsec = 300; } } } } if (comboBox5.SelectedItem == "15 Min") { no_of_ping = (15 * 60) / gapsec; } else { if (comboBox5.SelectedItem == "30 Min") { no_of_ping = (30 * 60) / gapsec; } else { if (comboBox5.SelectedItem == "1 Hour") { no_of_ping = (60 * 60) / gapsec; } else { if (comboBox5.SelectedItem == "2 Hour") { no_of_ping = (120 * 60) / gapsec; } else { if (comboBox5.SelectedItem == "3 Hour") { no_of_ping = (3 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "4 Hour") { no_of_ping = (4 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "5 Hour") { no_of_ping = (5 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "6 Hour") { no_of_ping = (6 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "7 Hour") { no_of_ping = (7 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "8 Hour") { no_of_ping = (8 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "9 Hour") { no_of_ping = (9 * 3600) / gapsec; } else { if (comboBox5.SelectedItem == "10 Hour") { no_of_ping = (10 * 3600) / gapsec; } else { MessageBox.Show("Please Recheck Time-Span"); } } } } } } } } } } } } textBoxEvents.AppendText("Creating Log For " + textBoxlabelOneTimeOnlyTag.Text + "\r\n"); plogstr = new ThreadStart(ping_log); plog = new Thread(plogstr); plog.Start(); }