public class IPAddress {
public static void main(String[] args) throws Throwable {
String[] cmd = {"C:\\WINDOWS\\system32\\cmd.exe","/c","start"};
try {
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec(cmd);
} catch (java.io.IOException exception) {
System.out.println("Caught IOException: " + exception.getMessage());
}
String release = "ipconfig /release";
String output1 = obj.executeCommand(release);
String renew = "ipconfig /renew";
String output2 = obj.executeCommand(renew);
System.out.println(output1);
System.out.println(output2);
}
}
IP Changer를 만들고 "String output1"및 "String output2"에 obj를 확인할 수 없다는 오류가 표시됩니다. 나는 이것을 풀려고했지만 아무 말도하지 말자.Obj를 (를) 확인할 수 없습니다.
어디서'obj'를 정의 했습니까? – SomeJavaGuy
'obj'가 무엇인가요? 어디에서 만들었습니까? –