Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DeviceInformation.CreateFromIdAsync(String) | createFromIdAsync(String) method

Applies to Windows and Windows Phone

Creates a DeviceInformation object from a DeviceInformation ID.

Syntax


Windows.Devices.Enumeration.DeviceInformation.createFromIdAsync(deviceId).done( /* Your success and error handlers */ );

Parameters

deviceId

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The device ID.

Return value

Type: IAsyncOperation<DeviceInformation>

An object for starting and managing the asynchronous creation of the DeviceInformation object.

Examples

The savedId variable in this example is a DeviceInformation ID previously saved by the application, obtained from the id property of the last-used DeviceInformation object.



    // Create a DeviceInformation object from a saved ID
    var Enum = Windows.Devices.Enumeration;
    var DevInf = Enum.DeviceInformation;
    DevInf.createFromIdAsync(savedId).then(
        function(devinfo) {
            // Use the created DeviceInformation object
            printMessage("Created DeviceInformation. Name: " + devinfo.name);
        },
        function (e) {
            displayError("Failed to create DeviceInformation: " + e.message);
        });


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Enumeration
Windows::Devices::Enumeration [C++]

Metadata

Windows.winmd

See also

DeviceInformation
CreateFromIdAsync(String, IIterable_1)

 

 

Show:
© 2014 Microsoft