views:

1865

answers:

2

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

A: 

Retrieving the Windows CE Device ID with the Microsoft .NET Compact Framework

consultutah
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?
John Saunders
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...
consultutah
Right. I meant are there better native methods.
John Saunders
+2  A: 

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#.

Shane Powell