Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: System Info - computer identification


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Feb 16, 2015 9:38 AM Last Post By: Remy Lebeau (Te...
David Ayre

Posts: 34
Registered: 10/11/00
System Info - computer identification  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2015 10:39 AM
Hi,

I have a situation where several computers running my software are using common data on a network,
and I would like to be able to log which computer has logged on.
Is there somewhere I can interrogate the computer running the software to identify which computer it is?
It just needs to be something common to that computer and not the others, but
it must remain constant.

Thanks,

David

Edited by: David Ayre on Feb 12, 2015 10:39 AM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: System Info - computer identification [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2015 11:56 AM   in response to: David Ayre in response to: David Ayre
David wrote:

I have a situation where several computers running my software are
using common data on a network, and I would like to be able to log
which computer has logged on.

How about logging the client IP address that is connecting?

Is there somewhere I can interrogate the computer running the software
to identify which computer it is?

The local computer can use the Win32 API GetComputerName() function, for
instance. Bu it would have to explicitly send that name to your server software.
Alternatively, your server software can use gethostbyaddr() or getnameinfo()
to perform a reverse DNS lookup to get the client's hostname using the client's
IP address that connects to the server.

It just needs to be something common to that computer and not
the others, but it must remain constant.

The computer's name/hostname is likely what you are looking for.

--
Remy Lebeau (TeamB)
David Ayre

Posts: 34
Registered: 10/11/00
Re: System Info - computer identification [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 14, 2015 1:38 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
The local computer can use the Win32 API GetComputerName() function, for
instance. Bu it would have to explicitly send that name to your server software.

Remy Lebeau (TeamB)

Thanks Remy,

I think GetComputerName() is what I'm looking for.

Cheers,

David
David Ayre

Posts: 34
Registered: 10/11/00
Re: System Info - computer identification  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 14, 2015 11:38 AM   in response to: David Ayre in response to: David Ayre
`Thanks Remy,

That has done the trick.

Cheers,

David
Mike Versteeg

Posts: 118
Registered: 9/16/07
Re: System Info - computer identification  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2015 2:02 AM   in response to: David Ayre in response to: David Ayre
But one can easily change that name, right?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: System Info - computer identification  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 16, 2015 9:38 AM   in response to: Mike Versteeg in response to: Mike Versteeg
Mike wrote:

But one can easily change that name, right?

Changing the computer name requires admin rights, and usually requires a
reboot to take effect.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02