Properties systemProperties = System.getProperties();
        systemProperties.setProperty("http.proxyHost","192.168.10.240");
        systemProperties.setProperty("http.proxyPort","8080");
HttpURLConnection conn =null;
        boolean checkNext = true;
        try
        { 
            
            conn =(HttpURLConnection)new URL("http://m.weather.com.cn/data/101010900.html").openConnection();
            String encoded = new String(Base64.encode(new String("kevin.ge:hellocarel5").getBytes()));
            conn.setRequestProperty("Proxy-Authorization", "Basic " + encoded);
            int result= conn.getResponseCode(); 
            String re=conn.getResponseMessage();    
            if(result==HttpURLConnection.HTTP_OK)
            {

相关文章:

  • 2022-12-23
  • 2021-12-15
  • 2021-11-30
  • 2021-08-12
  • 2022-12-23
  • 2021-12-18
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2021-07-14
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-01-02
相关资源
相似解决方案