05-09-2012, 07:58 AM
ane biasa gini om.. cek os dulu.. klo "win" baru di exec.. CMIIW
PHP Code:
public static void main(String[] args) {
String os = System.getProperty("os.name").toLowerCase();
if (os.indexOf("win") == 0) {
try {
Process p = Runtime.getRuntime().exec("cmd /c ipconfig");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = br.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
/***********************/
Don't blame others, let's say.. we solve it together
![[Image: thumb.png]](http://www.nafsuperawan.com/thumb.png)
Don't blame others, let's say.. we solve it together



