1 List<LanYa> lanYaList = new List<LanYa>(); //搜索到的蓝牙的集合 2 BluetoothClient client = new BluetoothClient(); 3 BluetoothRadio radio = BluetoothRadio.PrimaryRadio; //获取蓝牙适配器 4 radio.Mode = RadioMode.Connectable; 5 BluetoothDeviceInfo[] devices = client.DiscoverDevices();//搜索蓝牙 10秒钟 6 foreach (var item in devices) { 7 lanYaList.Add(new LanYa { blueName = item.DeviceName, blueAddress = item.DeviceAddress, blueClassOfDevice = item.ClassOfDevice, IsBlueAuth = item.Authenticated, IsBlueRemembered = item.Remembered, blueLastSeen = item.LastSeen, blueLastUsed = item.LastUsed });//把搜索到的蓝牙添加到集合中 8 }
,相关文章
- C语言dsPIC / PIC24 serial bootloader和C#语言bootloader PC端串口通信程序
- C语言RH850 F1KM serial bootloader和C#语言bootloader PC端串口通信程序
- C语言RL78 serial bootloader和C#语言bootloader PC端串口通信程序
- C语言PIC32 serial bootloader和C#语言bootloader PC端串口通信程序
- C语言RH850 F1L serial bootloader和C#语言bootloader PC端串口通信程序
- C语言PIC18 serial bootloader和C#语言bootloader PC端串口通信程序
- C语言PIC16 serial bootloader和C#语言bootloader PC端串口通信程序
- PC蓝牙通信C#代码实现
- PC上面的蓝牙的通信(C#)
- Windows系统中使用C#编写蓝牙通信程序的简单实例