| | |
Retrieving Computer Name
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
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
- 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 95 / 98 / 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: 726 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application apps arguments array arrays automation awt binary bluetooth businessintelligence busy_handler(null) card chat class classes client code collision component constructor database draw eclipse error event eventlistener exception file fractal game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me jar java javafx javamicroeditionuseofmotionsensor javaprojects jmf jni jpanel jtree julia link linux list loop machine map method methods mobile netbeans newbie nls number object oracle parsing plazmic print problem program programming project recursion scanner screen server set sharepoint size smart sms socket sort sortedmaps sql string swing test textfield threads time transfer tree unlimited webservices windows





