コード例 #1
0
        public void Init(out Exception error)
        {
            error = null;
            if(Utilities.IsXp()) return;

            try
            {
                WlanClient = new WlanClient();
            }
            catch (Win32Exception exception)
            {
                error = exception;
                return;
            }
            catch (DllNotFoundException)
            {
                error = new Exception(Localizer.GetString("WlanapiNotFound"));
                return;
            }

            WlanClient.InterfaceArrivedEvent.ItsEvent += WlanClient_InterfaceArrivedEvent;
            WlanClient.InterfaceRemovedEvent.ItsEvent += WlanClient_InterfaceRemovedEvent;
        }
コード例 #2
0
 internal WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info)
 {
     _client = client;
     _info = info;
 }
コード例 #3
0
ファイル: Scanner.cs プロジェクト: metageektrent/inSSIDer-2
 private void StartScanning(WlanClient.WlanInterface intf, int scaninterval)
 {
     if (intf == null) return;
     NetworkScanner.MyWlanInterface = intf;
     NetworkScanner.Start(scaninterval);
     return;
 }
コード例 #4
0
 public WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info)
 {
     _client = client;
     _info   = info;
 }
コード例 #5
0
ファイル: Scanner.cs プロジェクト: metageektrent/inSSIDer-2
        public bool Initalize(out Exception error)
        {
            error = null;
            NetworkScanner = new NetworkScanner();

            //Set new data handler
            NetworkScanner.NewNetworkDataEvent += NetworkScannerNewNetworkDataEvent;

            Cache = new NetworkDataCacheN();

            //GPS
            GpsControl = new GpsController();
            GpsControl.GpsUpdated += GpsControl_GpsUpdated;
            GpsControl.GpsTimeout += GpsControl_GpsTimeout;
            GpsControl.GpsError += GpsControl_GpsError;
            GpsControl.GpsLocationUpdated += GpsControl_GpsLocationUpdated;

            Logger = new GpxDataLogger { AutoSave = true, AutoSaveInterval = TimeSpan.FromSeconds(10) };

            //Null scanning
            _tNullScan.Elapsed += TNullScanElapsed;

            try
            {
                WlanClient = new WlanClient();
            }
            catch (Win32Exception exception)
            {
                error = exception;
                return false;
                //MessageBox.Show("Error Initializing Wlan Client: " + exception.Message + "\n\nWi-Fi data will not be displayed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            catch (DllNotFoundException)
            {
                error = new Exception(Localizer.GetString("WlanapiNotFound"));
                return false;
                //MessageBox.Show("Error: wlanapi.dll could not be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }

            return true;
        }