@@ -50,7 +50,7 @@ public static void GetAllClients(IView view, string interfacefriendlyname)
5050 StopTheLoadingBar ( view ) ;
5151
5252 }
53- catch ( PcapException ex )
53+ catch ( PcapException )
5454 {
5555 }
5656 }
@@ -161,7 +161,7 @@ public static void GetAllClients(IView view, string interfacefriendlyname)
161161
162162
163163 }
164- catch ( Exception ex )
164+ catch ( Exception )
165165 {
166166
167167 }
@@ -189,7 +189,6 @@ public static void GetAllClients(IView view, string interfacefriendlyname)
189189 view . ListView1 . Invoke ( new Action ( ( ) =>
190190 {
191191 string mac = GetMACString ( arppacket . SenderHardwareAddress ) ;
192- string machineName = "" ;
193192 int id = clientlist . Count - 1 ;
194193 string ip = arppacket . SenderProtocolAddress . ToString ( ) ;
195194 var obj = new Device ( ) ;
@@ -208,7 +207,7 @@ public static void GetAllClients(IView view, string interfacefriendlyname)
208207 view . ListView1 . UpdateObject ( obj ) ;
209208 } ) ) ;
210209 }
211- catch ( Exception ex )
210+ catch ( Exception )
212211 {
213212
214213 view . ListView1 . BeginInvoke ( new Action ( ( ) =>
@@ -257,14 +256,11 @@ public static void GetAllClients(IView view, string interfacefriendlyname)
257256 capturedevice = null ;
258257 BackgroundScanStart ( view , interfacefriendlyname ) ; //start passive monitoring
259258 }
260- catch ( PcapException ex )
259+ catch ( Exception )
261260 {
262261 view . MainForm . Invoke ( new Action ( ( ) => view . StatusLabel . Text = "Refresh for scan" ) ) ;
263262 }
264- catch ( Exception ex )
265- {
266-
267- }
263+
268264
269265 } ) . Start ( ) ;
270266 #endregion
@@ -393,13 +389,11 @@ public static void BackgroundScanStart(IView view, string interfacefriendlyname)
393389 }
394390 }
395391 }
396- catch ( PcapException ex )
392+ catch ( Exception )
397393 {
398394
399395 }
400- catch ( Exception ex )
401- {
402- }
396+
403397 } ) . Start ( ) ;
404398 #endregion
405399
@@ -417,7 +411,6 @@ public static void BackgroundScanStart(IView view, string interfacefriendlyname)
417411 view . ListView1 . Invoke ( new Action ( ( ) =>
418412 {
419413 string mac = GetMACString ( arppacket . SenderHardwareAddress ) ;
420- string machineName = "" ;
421414 int id = clientlist . Count - 1 ;
422415 string ip = arppacket . SenderProtocolAddress . ToString ( ) ;
423416 var obj = new Device ( ) ;
@@ -437,7 +430,7 @@ public static void BackgroundScanStart(IView view, string interfacefriendlyname)
437430 } ) ) ;
438431
439432 }
440- catch ( Exception ex )
433+ catch ( Exception )
441434 {
442435
443436 view . ListView1 . BeginInvoke ( new Action ( ( ) =>
@@ -494,7 +487,7 @@ public static void BackgroundScanStart(IView view, string interfacefriendlyname)
494487 #endregion
495488
496489 }
497- catch ( Exception ex )
490+ catch ( Exception )
498491 {
499492 }
500493 }
@@ -550,11 +543,12 @@ public static string GetMACString(PhysicalAddress physicaladdress)
550543 retval += physicaladdress . GetAddressBytes ( ) [ i ] . ToString ( "X2" ) + ":" ;
551544 return retval . Substring ( 0 , retval . Length - 1 ) ;
552545 }
553- catch ( Exception ex )
546+ catch ( Exception )
554547 {
555- throw ex ;
548+
556549 }
557550
551+ return default ;
558552 }
559553
560554
0 commit comments