title: How to get Device Id in Windows 8 Metro app
body: <p>How to get the unique Device in Windows Store App (Metro App)?</p>
  
  <p>Can we use:</p>
  
  <p><strong>Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null);</strong></p>
  
  <pre><code> Windows.System.Profile.HardwareToken hToke = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null);
  IBuffer hardwareId = hToke.Id;
  IBuffer signature = hToke.Signature;
  IBuffer certificate = hToke.Certificate;
  DataReader reader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId);
  byte[] ar = new Byte[hardwareId.Length];
  reader.ReadBytes(ar);
  string i = ar.ToString();
  string id = System.Text.Encoding.Unicode.GetString(ar, 0, ar.Length);
  System.Diagnostics.Debug.WriteLine("ID" + Convert.ToBase64String(ar));
  </code></pre>
  
  <p><strong>Network adapter Id of first Network adapter found</strong></p>
  
  <pre><code>IReadOnlyCollection&lt;Windows.Networking.Connectivity.ConnectionProfile&gt; profiles =
  Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles();
  Windows.Networking.Connectivity.NetworkAdapter na = profiles.First&lt;Windows.Networking.Connectivity.ConnectionProfile&gt;().NetworkAdapter;
  string nid =  na.NetworkAdapterId.ToString();
  </code></pre>