Esempio n. 1
0
 public void CheckThreadStart()
 {
     lock (this.ojb11)
     {
         if (this.YOUXIAN_IP != null || this.LUYOU_MAC != null)
         {
             if (CheckIPorMAC.IsInLab(this.YOUXIAN_IP, this.LUYOU_MAC, List_sever_ip))
             {
                 if (!this.IsThreadAlive && this.startTime == DateTime.MinValue && this.stopTime == DateTime.MinValue)
                 {
                     this.startTime     = DateTime.Now;
                     this.IsThreadAlive = true;
                 }
             }
             else
             {
                 this.startTime = DateTime.MinValue;
             }
         }
     }
 }
Esempio n. 2
0
 public void CheckThreadStop(bool ispoint)
 {
     lock (this.ojb22)
     {
         if (this.MACIP != null)
         {
             if (this.YOUXIAN_IP != null || this.LUYOU_MAC != null)
             {
                 if (CheckIPorMAC.IsInLab(this.YOUXIAN_IP, this.LUYOU_MAC, List_sever_ip))
                 {
                     if (!this.IsThreadAlive)
                     {
                         this.startTime = DateTime.MinValue;
                         this.stopTime  = DateTime.MinValue;
                     }
                     else
                     {
                         if (this.IsThreadAlive && this.stopTime == DateTime.MinValue && this.startTime != DateTime.MinValue)
                         {
                             if (!ispoint)
                             {
                                 this.stopTime = DateTime.Now.AddMinutes(-10.0);
                             }
                             else
                             {
                                 this.stopTime = DateTime.Now;
                             }
                             if (this.startTime != DateTime.MinValue && this.stopTime != DateTime.MinValue)
                             {
                                 this.t_d = new TimeDates();
                                 DateTime str = this.startTime;
                                 DateTime stp = this.stopTime;
                                 if (stp.Day - str.Day == 0)
                                 {
                                     this.t_d.WriteDateTOLog(str.ToString("yyyy-MM-dd HH:mm:ss"), stp.ToString("yyyy-MM-dd HH:mm:ss"));
                                     Form1.SendDate SuccessSendDate = new Form1.SendDate(this.t_d.SendDateToSever);
                                     IAsyncResult   async           = SuccessSendDate.BeginInvoke(this.MACIP, this.List_sever_ip, null, null);
                                     while (!async.IsCompleted)
                                     {
                                     }
                                 }
                                 this.startTime     = DateTime.MinValue;
                                 this.stopTime      = DateTime.MinValue;
                                 this.IsThreadAlive = false;
                             }
                             else
                             {
                                 this.startTime = DateTime.MinValue;
                                 this.stopTime  = DateTime.MinValue;
                             }
                             this.startTime = DateTime.MinValue;
                             this.stopTime  = DateTime.MinValue;
                         }
                         else
                         {
                             this.startTime = DateTime.MinValue;
                             this.stopTime  = DateTime.MinValue;
                         }
                     }
                 }
                 else
                 {
                     this.startTime = DateTime.MinValue;
                     this.stopTime  = DateTime.MinValue;
                 }
             }
             else
             {
                 this.startTime = DateTime.MinValue;
                 this.stopTime  = DateTime.MinValue;
             }
         }
         else
         {
             this.startTime = DateTime.MinValue;
             this.stopTime  = DateTime.MinValue;
         }
     }
 }