PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Retrieve computer name of CE device

Reply

Retrieve computer name of CE device

 
Thread Tools Rate Thread
Old 07-07-2003, 11:20 PM   #1
Ian Williamson
Guest
 
Posts: n/a
Default Retrieve computer name of CE device


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
Old 07-07-2003, 11:30 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Retrieve computer name of CE device

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@nospam.shaw.ca> wrote in message
news:047c01c344de$6c45ad40$a501280a@phx.gbl...
> 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
Old 08-07-2003, 09:56 AM   #3
Neil Cowburn [MVP]
Guest
 
Posts: n/a
Default Re: Retrieve computer name of CE device

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@nospam.shaw.ca> wrote in message
news:047c01c344de$6c45ad40$a501280a@phx.gbl...
> 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
Rate This Thread
Rate This Thread:

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