Retrieving Computer Name
Please support our Java advertiser: Programming Forums
Thread Solved
![]() |
hey guys,
I was wondering if there is anyway that my java app could retrieve the computer name.
IE
My computer could be named
I want to retreive
Thanks PO.
I was wondering if there is anyway that my java app could retrieve the computer name.
IE
My computer could be named
"PhiberOptik-desktop"
I want to retreive
"PhiberOptik-desktop" !Thanks PO.
History will be kind to me for I intend to write it.
---------------------------------- Sir Winston Churchill
---------------------------------- Sir Winston Churchill
Nevermind Figured it out!
java Syntax (Toggle Plain Text)
import java.net.*; class myName { public static void main (String args[]) { try { InetAddress address = InetAddress.getLocalHost(); System.out.println("Hello. My name is " + address.getHostName()); } catch (UnknownHostException e) { System.out.println("I'm sorry. I don't know my own name."); } } }
History will be kind to me for I intend to write it.
---------------------------------- Sir Winston Churchill
---------------------------------- Sir Winston Churchill
![]() |
Similar Threads
Other Threads in the Java Forum
- How To Save in our Computer (Perl)
- C++ computer memory access (C++)
- Storing and Retrieving Number String/Array (PHP)
- Retrieving data from a HDD (Storage)
- Help!! Applet only works in AppletViewer but not in html file with <applet> tags!!! (Java)
- Data Error: cyclic redundancy check (Windows 9x / Me)
- Retrieving data from old hard drive (Storage)
Other Threads in the Java Forum
- Previous Thread: IEEE format to decimal conversion
- Next Thread: java vs .net
•
•
•
•
Views: 431 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)





Linear Mode