DeniedBySystem returned when i was used PhoneLineTransportDevice::RequestAccessAsync

栩 王 0 Reputation points
2024-05-07T08:44:33.0533333+00:00

I try to requset PhoneLineTransportDevice access with below code. It works fine in my Win10 22H2, but failed when i try to run in my Win11 23H2.

would you like to give some advice?

1, Why it was failed DeniedBySystem in win11 ?

2, How to solve it ?

thanks very much

DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(PhoneLineTransportDevice.GetDeviceSelector(PhoneLineTransport.Bluetooth));
var device = devices[0];
var phone = PhoneLineTransportDevice.FromId(device.Id);
var requestAccess = await phone.RequestAccessAsync();
Universal Windows Platform (UWP)
{count} votes