To get computer name

R

Ravi Shankar

Hi all,

Is there anyway, I can get the computer name. I know well of this program:-

public static String getComputerName(){
try{
return InetAddress.getLocalHost().getHostName();
}
catch(Exception e){
return "unknown";
}
}

But, assume that a computer has Japanese XP installed or Chinese XP
installed in which they will have their names in Japanese ro Chinese
repectively. In such cases, how can I get the hostname??

Warmest regards,
Ravi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top