EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

HardwareIdentification class

Applies to Windows and Windows Phone

Provides the ability to obtain a hardware identifier that represents the current hardware.

Syntax


var hardwareIdentification = Windows.System.Profile.HardwareIdentification;

Attributes

[MarshalingBehavior(Standard)]
[Version(0x06020000)]

Members

The HardwareIdentification class has these types of members:

Methods

The HardwareIdentification class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetPackageSpecificToken Gets a hardware identifier (ASHWID) that represents the current hardware.

 

Remarks

See Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic for more information.

Note  : This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Examples

The following code shows how to get the hardware id of a device using GetPackageSpecificToken.


// nonce is an IBuffer object that would be sent from the cloud service.
var packageSpecificToken;

packageSpecificToken =  Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(nonce);

// hardware id, signature, certificate IBuffer objects 
// that can be accessed through properties.
var hardwareId = packageSpecificToken.id;
var signature = packageSpecificToken.signature;
var certificate = packageSpecificToken.certificate;



Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.System.Profile
Windows::System::Profile [C++]

Metadata

Windows.winmd

See also

Object
Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic

 

 

Mostrar:
© 2014 Microsoft