Represents a device. This class allows access to well-known device properties as well as additional properties specified during device enumeration.
The DeviceInformation class has these types of members:
The DeviceInformation class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|CreateFromIdAsync(String)||Creates a DeviceInformation object from a DeviceInformation ID.|
|CreateFromIdAsync(String,IIterable(String))||Creates a DeviceInformation object from a DeviceInformation ID and a list of additional properties.|
|CreateWatcher||Creates a DeviceWatcher for all devices.|
|CreateWatcher(DeviceClass)||Creates a DeviceWatcher for devices matching the specified DeviceClass.|
|CreateWatcher(String)||Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string.|
|CreateWatcher(String,IIterable(String))||Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string and the specified collection of properties.|
|FindAllAsync||Enumerates all DeviceInformation objects.|
|FindAllAsync(DeviceClass)||Enumerates DeviceInformation objects of the specified class.|
|FindAllAsync(String)||Enumerates DeviceInformation objects matching the specified Advanced Query Syntax (AQS) string.|
|FindAllAsync(String,IIterable(String))||Enumerates DeviceInformation objects matching the specified Advanced Query Syntax (AQS) string and including the specified collection of properties.|
|GetGlyphThumbnailAsync||Gets a glyph for the device.|
|GetThumbnailAsync||Returns a thumbnail image for the device.|
|Update||Updates the properties of an existing DeviceInformation object.|
The DeviceInformation class has these properties.
|Read-only||The physical location of the device in its enclosure.|
|Read-only||A string representing the identity of the device.|
|Read-only||Indicates whether this device is the default device for the class.|
|Read-only||Indicates whether this device is enabled.|
|Read-only||The name of the device.|
|Read-only||Property store containing well-known values as well as additional properties that can be specified during device enumeration.|
The Name property should only be used for display purposes only and not for finding a device because the Name can change due to localization or a user assigning a name.
CreateFromIdAsync creates a DeviceInformation object if successful.
The DeviceInformation class provides device information, but more specifically, it provides properties of the device interface, the interface that represents functionality that the device exposes. Multi-function devices may have more than one device interface. The physical object that a user sees as a device, is known as the device container, and has properties such as Manufacturer and ModelID. For a list of properties associated with device interfaces, device containers, and other PnP objects, see the list of canonical properties in How to retrieve additional properties for a device or PnP object. For tutorials on how to use the DeviceInformation class to get device information, see How to retrieve additional properties for a device or PnP object, How to retrieve related PnP objects, and Quickstart: Enumerating device containers.
This example incrementally enumerates devices, adding them to a list each time a device is found, and also handling removals and updates.
Minimum supported client
|Windows 8 [Windows Store apps, desktop apps]|
Minimum supported server
|Windows Server 2012 [Windows Store apps, desktop apps]|
Minimum supported phone
|Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]|