9910

单飞

   :: 首页 :: 联系 :: 聚合  :: 管理
    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""");
        }
    }
posted on 2009-04-14 13:53 单飞 阅读(401) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: