我想断开我的计算机与互联网的连接,我能想到的最好方法是从 cmd 运行 ipconfig/release。为此,我做到了
Process result = Runtime.getRuntime().exec("ipconfig/release");
然而,这会引发错误,
java.io.IOException: Cannot run program "ipconfig/release": CreateProcess error=
2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at threadio.run(checkmac.java:141)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
我不确定这是什么意思。
任何想法我做错了什么?与路由器断开连接有更好的选择吗?