Created
August 11, 2014 19:13
-
-
Save vladimir-kotikov/e19c8642548f9f1cb4c5 to your computer and use it in GitHub Desktop.
How to get device manufacturer and model in windows store apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var propertiesToRetrieve = ["System.Devices.ModelName", "System.Devices.Manufacturer"]; | |
var pnp = Windows.Devices.Enumeration.Pnp; | |
var deviceContainer = pnp.PnpObjectType.deviceContainer; | |
var ROOT_DEVICE_ID = '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}'; | |
pnp.PnpObject.findAllAsync(deviceContainer, propertiesToRetrieve) | |
.then(function (devinfoCollection) { | |
for (var i = 0; i < devinfoCollection.length; i++) { | |
if (devinfoCollection[i].id == ROOT_DEVICE_ID) { | |
console.log(JSON.stringify(devinfoCollection[i].properties)); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment