写了一个语句:
BluetoothDeviceInfo[] devices = client.DiscoverDevices();
报错是:
无法将类型“System.Collections.Generic.IReadOnlyCollection<InTheHand.Net.Sockets.BluetoothDeviceInfo>”隐式转换为“InTheHand.Net.Sockets.BluetoothDeviceInfo[]”。存在一个显式转换(是否缺少强制转换?)
写成 BluetoothDeviceInfo[] devices = (BluetoothDeviceInfo[])client.DiscoverDevices() 来强制转换也不行。运行时还是报错,显示无法强转。
想知道System.Collections.Generic.IReadOnlyCollection< >这是一个什么类型的数据,我试了赋值给List< BluetoothDeviceInfo >也是类似报错。