How to read Serial number from mobile device using C#?

14,540

You really shouldn't be using the old KernelIoControl method.

You should use the newer GetDeviceUniqueID API. Here is a blog entry on why to use it and how to use it from C#.

Share:
14,540
Gold
Author by

Gold

Updated on June 11, 2022

Comments

  • Gold
    Gold almost 2 years

    How I can read Serial number from a Windows mobile and WinCE mobile device using C#?

  • John Saunders
    John Saunders almost 15 years
    Interesting. I take that article to imply that some devices may not have a unique id. It seems to be something that "can be used by OEMs who need unique identifications". Also, the article was a bit old. Do you know if that IOCTL is still valid in later versions of Windows CE, or if maybe there's a better method in later versions?
  • ConsultUtah
    ConsultUtah almost 15 years
    As far as I know there is nothing built-in. You must call native methods to get it - I have been away from the CompactFramework for a while though...
  • John Saunders
    John Saunders almost 15 years
    Right. I meant are there better native methods.