| Author |
Redirecting the output
|
omar bili
Ranch Hand
Joined: Aug 13, 2004
Posts: 177
|
|
hi all i need to know how to get the Mac address of the network card and the computer IP . On windows there is the command ipconfig if i can execute this command using : Runtime.getRuntime().exec("ipconfig") can i store the result in a text file ?? and read this text file later . ( i know that in Unix it is called Redirecting the output we used to use it like this : "ps -all >> tempFile.txt" ) i hope that my request is clear thx in advance
|
 |
Peter Chase
Ranch Hand
Joined: Oct 30, 2001
Posts: 1970
|
|
You can get all the network interfaces on the machine, via pure Java, using java.net.NetworkInterface.getNetworkInterfaces(). For each of these, you can get a list of java.net.InetAddress, from which you can get an IP address. Most machines have one adapter with one IP address, but some are more complicated. I don't think you can get the MAC address with pure Java. What do you want it for?
|
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
|
 |
 |
|
|
subject: Redirecting the output
|
|
|