public static void main(String[] args) throws IOException {
String ip = "123.123.123.123:1234";
String s = "REGEDIT4\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings]\n\"ProxyEnable\"=dword:00000001\n\"ProxyServer\"=\""+ip+"\"\n\"ProxyOverride\"=\"<localhost>\"";
FileWriter fw = new FileWriter("f://test.reg");
fw.write(s);
fw.close();
Runtime.getRuntime().exec( "reg.exe import f://test.reg");
}
java设置本地IP代理
最新推荐文章于 2024-05-25 16:34:52 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)