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」とは何ですか?あなたはどこでそれを作りましたか? –