private void btnStopSending_Click(object sender, EventArgs e)
 {
     btnStart.Enabled       = true;
     btnStopSending.Enabled = false;
     UploadTimer.Enabled    = false;
     UploadTimer.Stop();
 }
        private void UploadTimer_Tick(object sender, EventArgs e)
        {
            UploadTimer.Enabled = false;
            UploadTimer.Stop();
            lblErrorMsg.Text = "";
            ExporttoExcel();

            if (System.IO.File.Exists("E:\\ContainerSearch\\ContainerList.xls"))
            {
                Thread.Sleep(1 * 60 * 1000);

                Upload(FileName);
                lblErrorMsg.Text = "";
            }
            UploadTimer.Enabled = true;
            UploadTimer.Start();
        }
Ejemplo n.º 3
0
        public void uploadtimerfile()
        {
            UploadTimer.Enabled = false;
            UploadTimer.Stop();
            lblErrorMsg.Text = "";
            ExporttoExcel();

            if (System.IO.File.Exists(Path))
            {
                Thread.Sleep(5 * 1000);

                Upload(FileName);
                lblErrorMsg.Text = "";
            }
            UploadTimer.Enabled = true;
            UploadTimer.Start();
        }
Ejemplo n.º 4
0
 public void FileUploadTimeSlot()
 {
     if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "00:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "01:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "02:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "03:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "04:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "05:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "06:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "07:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "08:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "09:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "10:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "11:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "12:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "13:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "14:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "15:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "16:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "17:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "18:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "19:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "20:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "21:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "22:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
     else if ((String.Format(DateTime.Now.ToString("HH:mm:ss"), "HH:mm:ss") == "23:00:00"))
     {
         UploadTimer.Stop();
         uploadtimerfile();
         UploadTimer.Start();
     }
 }