C# 按下“后退”按钮时,如何在32英尺的BluetoohDevicePicker碰撞周围工作?

C# 按下“后退”按钮时,如何在32英尺的BluetoohDevicePicker碰撞周围工作?,c#,windows-phone-8,bluetooth,32feet,C#,Windows Phone 8,Bluetooth,32feet,我目前正在我的项目中使用,我发现了一个我觉得无法控制的小错误。简单地说,当我称之为: BluetoothDevicePicker btPicker = new BluetoothDevicePicker(); PeerInformation peerInfo = await btPicker.PickDeviceAsync(); deviceName = peerInfo.HostName; 这会调出一个配对设备的列表,但是如果我按下后退按钮而不是选择一个设备,我的应用程序就会崩溃。我想知道

我目前正在我的项目中使用,我发现了一个我觉得无法控制的小错误。简单地说,当我称之为:

BluetoothDevicePicker btPicker = new BluetoothDevicePicker(); 
PeerInformation peerInfo = await btPicker.PickDeviceAsync();
deviceName = peerInfo.HostName;

这会调出一个配对设备的列表,但是如果我按下后退按钮而不是选择一个设备,我的应用程序就会崩溃。我想知道是否有解决办法?我已经在32英尺的网站上发布了,但它看起来太不活跃了。

嗯,在最坏的情况下,你可以从上面的项目中获取源代码,自己调试(并了解依赖不活跃项目的成本)

您不会描述崩溃,但是如果它是托管异常,您可以在这段代码周围放置一个
try{}catch{}