static void Main(string[] args)
        {
            NSApplication.Init();

            using (new NSAutoreleasePool())
            {
                string[] interfaces = CWInterface.SupportedInterfaces;

                if (interfaces.Length < 1)
                {
                    Console.WriteLine("No supported interface is available in this computer");
                    return;
                }

                CWInterface selectedIntface = CWInterface.FromName(interfaces[0]);
                // print interface information
                Console.WriteLine("\nInterface Information:\nName: {0}, Active SSID: {1}, Active BSSID: {2}\n", selectedIntface.Name, selectedIntface.Ssid, selectedIntface.Bssid);

                NSError     error;
                CWNetwork[] data = selectedIntface.ScanForNetworksWithParameters(null, out error);

                if (error != null)
                {
                    Console.Error.WriteLine("An error occurred while scanning for available networks");
                    return;
                }

                foreach (CWNetwork d in data)
                {
                    Console.Write("SSID: {0}, BSSID: {1}\n", d.Ssid, d.Bssid);
                }
            }
        }
Exemple #2
0
        partial void interfaceSelected(NSObject sender)
        {
            if (supportedInterfacesPopup.SelectedItem != null)
            {
                CurrentInterface = CWInterface.FromName(supportedInterfacesPopup.SelectedItem.Title);
            }
            else
            {
                CurrentInterface = null;
            }

            UpdateInterfaceInfoTab();
        }
        void WirelessInterfaceSelected()
        {
            if (WirelessInterfaceButton.SelectedItem != null)
            {
                currentInterface = CWInterface.FromName(WirelessInterfaceButton.SelectedItem.Title);
            }
            else
            {
                currentInterface = null;
            }

            UpdateWirelessInterfaceUI();
        }