This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Capture computer name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Capture computer name" Watch "Capture computer name" New topic
Author

Capture computer name

Hui Ge
Greenhorn

Joined: Mar 11, 2005
Posts: 25
Hi,
Let's say i want to develop a web app that authenticates user via their computer name. Is there anything in the APi that can get the user to send their computer name over to the server to be captured?

Thanks in advance.
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Use the java.net.InetAddress class. The getLocalHost() method will return an InetAddress reference, on which you call the getHostName() method:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Capture computer name