在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 public bool WaitData() 2 { 3 bool states = false; 4 try 5 { 6 DateTime Get_Time = DateTime.Now; 7 while (!DeviceStates) 8 { 9 Thread.Sleep(10); 10 if (DeviceStates == true) 11 { 12 states = true; 13 return states; 14 } 15 16 TimeSpan P_TimeSpan = DateTime.Now - Get_Time; 17 if (P_TimeSpan.Seconds >= 1) 18 { 19 states = false; 20 return states; 21 } 22 } 23 return states; 24 } 25 catch (Exception ex) 26 { 29 return states; 30 } }
|
请发表评论