private static LibPcapLiveDevice getDeviceFromIndex(int selectedIndex) { var devices = ArpScanner.getDeviceList(); var selectedDevice = devices[selectedIndex]; return(selectedDevice); }
public Form2() { InitializeComponent(); foreach (var device in ArpScanner.getDeviceList()) { //Console.WriteLine(device.Description); comboBox1.Items.Add(device.Description); } comboBox1.SelectedIndex = ArpScanner.deviceIndex; comboBox1.SelectedIndexChanged += ComboBox1_SelectedIndexChanged; var selectedDevice = getDeviceFromIndex(ArpScanner.deviceIndex); populateDeviceIPAddrs(selectedDevice); }