private void serialPortsMenuItem_Click(object sender, RoutedEventArgs e) { var ports = Informator.GetAllSerialPorts(); var info = "Actual serial ports:\r"; foreach (var portName in ports) { info += string.Format(" - {0}\r", portName); } ShowMessage(info); }
private void myIPMenuItem_Click(object sender, RoutedEventArgs e) { string message = ""; var ips = Informator.GetAllLocalIPv4(NetworkInterfaceType.Ethernet); AddIpsToMessage("Ethernet IPs:", ips, ref message); ips = Informator.GetAllLocalIPv4(NetworkInterfaceType.Wireless80211); AddIpsToMessage("Wireless IPs:", ips, ref message); ShowMessage(message); logTextBox.ScrollToEnd(); }