| | |
Retrieving Computer Name
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
| Thread Tools | Search this Thread |
account android api applet application array arrays automation bidirectional binary birt bluetooth class classes client code columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors exception expand fractal game givemetehcodez graphics gui guidancer homework html ide image inetaddress inheritance integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux list loop map method methods midlethttpconnection mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program project property recursion ria scanner search server set sharepoint smart sms smsspam sort sourcelabs splash sql sqlite static string subclass support swing testautomation threads tree unlimited webservices windows





