По вашему требованию вы можете использовать Windows.Devices.Enumeration
API для получения портативного устройства хранения.Для более подробной информации вы можете обратиться к DeviceEnumaerationAndPairing сценарий 2.
handlerAdded = new TypedEventHandler<DeviceWatcher, DeviceInformation>(async (watcher, deviceInfo) =>
{
// Since we have the collection databound to a UI element, we need to update the collection on the UI thread.
await rootPage.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
{
ResultCollection.Add(new DeviceInformationDisplay(deviceInfo));
rootPage.NotifyUser(
String.Format("{0} devices found.", ResultCollection.Count),
NotifyType.StatusMessage);
});
});
Тогда вы можете получить уникальный идентификатор из deviceInfo
объекта.