Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8413767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:59:11+00:00 2026-06-10T00:59:11+00:00

I am currently trying to retrieve a unique device identifier. Here is my code:

  • 0

I am currently trying to retrieve a unique device identifier. Here is my code:

var token = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null);
var reader = Windows.Storage.Streams.DataReader.fromBuffer(token.id);

reader.unicodeEncoding = true;
var identifier = reader.readString(reader.unconsumedBufferLength);

console.log(identifier);

But it raises following error:

The operation attempted to access data outside the valid range.

How can I retrieve the size of my token.id string? I also tried to use token.id.length, but result is the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:59:12+00:00Added an answer on June 10, 2026 at 12:59 am

    I can’t try to replicate what you’re doing at the moment, but you might try reading it as bytes into array like this:

    var array = new Array(token.id.length);
    reader.readBytes(array);
    

    And then convert the array to a string for the identifier.

    See these posts for examples:

    • http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/1e2175e3-fe07-4094-9454-b3ecf1bf0381
    • http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/cdf72b9f-b3c0-488e-b607-b4445a5039b3
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to parse an HTML document to retrieve all of the
I am currently trying to build a little widget that will retrieve a list
I am currently trying to write some code that will accept some FTP details,
I'm trying to retrieve the access level (admin/member/guest) for the currently logged in user
I'm trying to build a safe user authentication system. The code is from http://net.tutsplus.com/tutorials/php/simple-techniques-to-lock-down-your-website/
I'm trying to retrieve all profile pictures for a user in facebook. So far,
I'm currently trying to retrieve the coordinates of the cursor using function getCursor(event) {
I am currently trying to retrieve YouTube video IDs through url. I created a
I am trying to retrieve all the artists on the local iOS device, and
Using C# i'm trying to retrieve the name of the song that is currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.