how to find machine name
hi,
i would like to write a java program to find out the machine name.
for example, if i run that java program on my machine so it should return my machine name.
if someone already written that kind of code, please send it to me
thanks for your help and have a great weekend
I was half joking with the troll comment, lol, but yea that thread just continued on and on with his flood posting.at least he always keeps it local to one thread.
> > Why? Do you want to be a troll like myorak?
>
> Troll?
>
> I wasn't here, what happened with that thread
> (besides it getting deleted)?
He combined the image trickery with the posting voodoo for evil. Because the image thing is just a url right.... one can use whatever url one wants.
> > He combined the image trickery with the posting
> > voodoo for evil. Because the image thing is just a
> > url right.... one can use whatever url one wants.
>
> I saw that part, but I had to leave right
> afterwards...
Well he posted several and it went bananas. It was well over 100 replies last I saw.
/**
* @(#)AddressCheck.java
*
*
* @author
* @version 1.00 2007/6/9
*/
import java.net.*;
public class AddressCheck {
public static void main(String[] args) {
String address = "";
try {
address=InetAddress.getLocalHost().toString();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(address);
}
}
running on my machine will print
saloo/192.168.1.105