Retrieve computer name of CE device

I

Ian Williamson

Greetings,

Any thoughts on how to return the computer name of the CE
handheld? I am trying to invoke GetComputerName, but
either it is not supported or I am using the wrong
parameter list.

Cheers, Ian Williamson
 
P

Paul G. Tobey [eMVP]

I think that WinSock's gethostname() will give you the name. As far as I
can find, GetComputerName doesn't exist in Windows CE...

Paul T.
 
N

Neil Cowburn [MVP]

You can look this up in the registry at HKLM\Ident\Name

Using our Registry class, this is easy:

string deviceName = null;
int size = 128;

RegKey reg = new RegKey();
reg.Open(RegKey._HKEY_LOCAL_MACHINE,"Ident");
reg.QueryValue(out deviceName, "Name", ref size);
reg.Close();

HTH
Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top