Beispiel #1
0
        public static bool IsSSIDAvailable(string ssid)
        {
            try
            {
                var ssidUpper = ssid.ToUpper();

                using (WlanClient wc = new WlanClient())
                {
                    foreach (WlanClient.WlanInterface intf in wc.Interfaces)
                    {
                        foreach (var network in intf.GetAvailableNetworkList(Wlan.WlanGetAvailableNetworkFlags.IncludeAllAdhocProfiles))
                        {
                            string detectedSSID = Encoding.Default.GetString(network.dot11Ssid.SSID);
                            if (detectedSSID.ToUpper().Contains(ssidUpper) && network.networkConnectable)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
            catch (Exception ex) { Logger.Log("Scanning SSIDs failed", ex); }

            return(false);
        }
Beispiel #2
0
        public static string GetCurrentSSID()
        {
            try
            {
                using (WlanClient wc = new WlanClient())
                {
                    foreach (WlanClient.WlanInterface intf in wc.Interfaces)
                    {
                        if (intf.InterfaceState != Wlan.WlanInterfaceState.Connected)
                        {
                            continue;
                        }
                        if (intf.CurrentConnection.isState != Wlan.WlanInterfaceState.Connected)
                        {
                            continue;
                        }

                        return(intf.CurrentConnection.profileName);
                    }
                }
            }
            catch (Exception ex) { Logger.Log("Getting WLAN SSID failed", ex); }

            return(String.Empty);
        }
Beispiel #3
0
        public static string GetCurrentSSID()
        {
            try
            {
                using (WlanClient wc = new WlanClient())
                {
                    foreach (WlanClient.WlanInterface intf in wc.Interfaces)
                    {
                        if (intf.InterfaceState != Wlan.WlanInterfaceState.Connected)
                            continue;
                        if (intf.CurrentConnection.isState != Wlan.WlanInterfaceState.Connected)
                            continue;

                        return intf.CurrentConnection.profileName;
                    }
                }
            }
            catch (Exception ex) { Logger.Log("Getting WLAN SSID failed", ex); }

            return String.Empty;
        }
Beispiel #4
0
        public static bool IsSSIDAvailable(string ssid)
        {
            try
            {
                var ssidUpper = ssid.ToUpper();

                using (WlanClient wc = new WlanClient())
                {
                    foreach (WlanClient.WlanInterface intf in wc.Interfaces)
                    {
                        foreach (var network in intf.GetAvailableNetworkList(Wlan.WlanGetAvailableNetworkFlags.IncludeAllAdhocProfiles))
                        {
                            string detectedSSID = Encoding.Default.GetString(network.dot11Ssid.SSID);
                            if (detectedSSID.ToUpper().Contains(ssidUpper) && network.networkConnectable)
                                return true;
                        }
                    }
                }
            }
            catch (Exception ex) { Logger.Log("Scanning SSIDs failed", ex); }

            return false;
        }
Beispiel #5
0
			internal WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info)
			{
				this.client = client;
				this.info = info;
			}
Beispiel #6
0
 internal WlanInterface(WlanClient client, Wlan.WlanInterfaceInfo info)
 {
     this.client = client;
     this.info   = info;
 }