locked
requirement in my enterprise Windows 8 Modern App to fetch the SD Card id (Vendor ID) for the win8 application

    Question

  • Hi Team,

     

    Greetings! I have requirement in my enterprise Windows 8 Modern App to fetch the SD Card id (Vendor ID) for the win8 application. Using this SD Card Id I would need to compare the device id in my database to confirm the SD Card used is authorized or not to perform some action.

     

    But my team were not able to get the SD Card Id as Microsoft Windows 8 Storage Device API does not provide any information about the SD Card like, Storage Type, SD Card Id etc..

     

    Sample SD Card ID :

     

    Please advise?

    Thanks in advance.

    Thanks,

    Mansi

    Friday, November 21, 2014 12:15 PM

Answers

  • Hello Extramarks,

    Try the following code below and let me know if it helps.

    private async Task EnumRemovableDevices()
    {
          var myDevices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(
                    Windows.Devices.Portable.StorageDevice.GetDeviceSelector(), null);
                
          foreach(var device in myDevices)
          {
               var name = device.Name; //Removable device name
               var id = device.Id; //Removable device info should be contained in here.
               var deviceProps = device.Properties; //additional info here
    
               foreach (var deviceProp in deviceProps)
               {
                   var deviceKey = deviceProp.Key;
                   var deviceValue = deviceProp.Value;
               }
          }
    }

    Hope this helps.


    Abdulwahab Suleiman

    Saturday, November 22, 2014 2:42 AM
    Moderator