@@ -219,17 +219,17 @@ private static void DeepRestart()
219219 }
220220 } , prefix : DeepRestartPrefix ) ;
221221 Try ( ( ) =>
222- {
223- Console . WriteLine ( "正在启动服务 {0}……" , sa . DisplayName ) ;
224- sa . Start ( ) ;
225- sa . WaitForStatus ( ServiceControllerStatus . Running , new TimeSpan ( 0 , 1 , 0 ) ) ;
226- } , prefix : DeepRestartPrefix ) ;
227- Try ( ( ) =>
228222 {
229223 Console . WriteLine ( "正在启动服务 {0}……" , w . DisplayName ) ;
230224 w . Start ( ) ;
231225 w . WaitForStatus ( ServiceControllerStatus . Running , new TimeSpan ( 0 , 1 , 0 ) ) ;
232226 } , prefix : DeepRestartPrefix ) ;
227+ Try ( ( ) =>
228+ {
229+ Console . WriteLine ( "正在启动服务 {0}……" , sa . DisplayName ) ;
230+ sa . Start ( ) ;
231+ sa . WaitForStatus ( ServiceControllerStatus . Running , new TimeSpan ( 0 , 1 , 0 ) ) ;
232+ } , prefix : DeepRestartPrefix ) ;
233233 WlanManager . Restart ( ) ;
234234 }
235235 private static void Close ( )
@@ -500,13 +500,16 @@ private static string QueryCurrentDevices(bool wait = false)
500500 }
501501 private static void WatchCurrentDevices ( )
502502 {
503+ string previous = null ;
503504 while ( true )
504505 {
505506 if ( Console . KeyAvailable && Console . ReadKey ( ) . Key == ConsoleKey . Escape ) break ;
506507 var result = QueryCurrentDevices ( ) ;
508+ if ( result == previous ) continue ;
509+ previous = result ;
507510 Console . Clear ( ) ;
508511 Console . WriteLine ( "监视已连接设备中,按 Esc 键返回。" ) ;
509- Console . WriteLine ( result ) ; // prevent flashing
512+ Console . WriteLine ( result ) ;
510513 Thread . Sleep ( 500 ) ;
511514 }
512515 Console . Clear ( ) ;
0 commit comments