Пример #1
0
        /// <summary>
        /// 无线连接
        /// </summary>
        /// <returns></returns>
        public static bool IsWirelessNetworkConnected()
        {
            var adaters = NetworkInterfaceHelper.GetAllAdapters();

            if (adaters.Any(i => i.Name.ToString().Contains("WLAN") && i.OperationalStatus == OperationalStatus.Up))
            {
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// 是否含有蓝牙模块
        /// </summary>
        /// <returns></returns>
        public static bool HasBluetoothNetwork()
        {
            var networkInterfaces = NetworkInterfaceHelper.GetAllAdapters();

            return(networkInterfaces.Any(i => i.Description.Contains("Bluetooth")));
        }