• Post Reply Bookmark Topic Watch Topic
  • New Topic

System Property for PC name?  RSS feed

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me what the key is for getting the PC Name using the System.getProperty(String string) method?

I am assuming that is what I would use, correct?

Thanks in advance!
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see System.getProperties try iterating though the the resulting Properties object and see if what you want is there.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.net.InetAddress.getLocalHost().getHostName() does the trick.

Jules
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!