检索使用的WinRT一个设备的序列号序列号、设备、WinRT

由网友(诗酒趁年少)分享简介:我们正在一个应用程序,需要知道它正在运行的设备的序列号。该应用程序是为保险公司与用户能够直接获得保险装置。为保险政策需要的序列号。是否有可能检索设备的使用WinRT的,或可在Metro风格应用程序中使用任何API序列号?We are working on an app that needs to know the s...

我们正在一个应用程序,需要知道它正在运行的设备的序列号。该应用程序是为保险公司与用户能够直接获得保险装置。为保险政策需要的序列号。是否有可能检索设备的使用WinRT的,或可在Metro风格应用程序中使用任何API序列号?

We are working on an app that needs to know the serial number of the device it is running on. The app is for an insurance company with which the user is able to directly get insurance for the device. For the insurance policy the serial number is needed. Is it possible to retrieve the serial number of the device using the WinRT or any API that can be used in a metro style app?

推荐答案

我不知道这是否完全适合您的需求,但它是能够唯一标识设备(因为Windows 8 RTM)。

I do not know if it exactly fits your need, but it is possible to uniquely identify a device (since Windows 8 RTM).

private string GetHardwareId()
{
    var token = HardwareIdentification.GetPackageSpecificToken(null);
    var hardwareId = token.Id;
    var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId);

    byte[] bytes = new byte[hardwareId.Length];
    dataReader.ReadBytes(bytes);

    return BitConverter.ToString(bytes);
}  
阅读全文

相关推荐

最新文章