HighTechTalks DotNet Forums  

Retrieve computer name of CE device

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss Retrieve computer name of CE device in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Ian Williamson
 
Posts: n/a

Default Retrieve computer name of CE device - 07-07-2003 , 07:20 PM






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



Reply With Quote
  #2  
Old   
Paul G. Tobey [eMVP]
 
Posts: n/a

Default Re: Retrieve computer name of CE device - 07-07-2003 , 07:30 PM






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.

"Ian Williamson" <bmcpeake (AT) nospam (DOT) shaw.ca> wrote

Quote:
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





Reply With Quote
  #3  
Old   
Neil Cowburn [MVP]
 
Posts: n/a

Default Re: Retrieve computer name of CE device - 07-08-2003 , 05:56 AM



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

--
Neil Cowburn
OpenNETCF.org Advisory Board Member

www.opennetcf.org



"Ian Williamson" <bmcpeake (AT) nospam (DOT) shaw.ca> wrote

Quote:
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





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.