public static void setProxy(String ip,int port) throws RegistryErrorException{
Regor reg = new Regor();
Key ie = reg.openKey(Regor.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings");
if(ie!=null){
reg.setValue(ie, "ProxyServer", ip+":"+port);
reg.saveDword(ie, "ProxyEnable", Integer.toHexString(1));
}
}
public static void disableProxy() throws RegistryErrorException{
Regor reg = new Regor();
Key ie = reg.openKey(Regor.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings");
if(ie!=null){
reg.saveDword(ie, "ProxyEnable", Integer.toHexString(0));
reg.setValue(ie, "ProxyServer", "");
}
}