/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package main_client; /** * * @author H3R3T1C */ import java.net.*; import java.io.*; public class GetCode { public String netGetCode(String address) { URL url = null; try { url = new URL(address); } catch (MalformedURLException ex) { } InputStream html = null; try { html = url.openStream(); } catch (IOException ex) { } int c = 0; String Buffer = ""; String Code = ""; while(c != -1) { try { c = html.read(); } catch (IOException ex) { } Buffer=Buffer+(char)c; if(Buffer.length()==11) { if(Buffer.equalsIgnoreCase("")) { if(Buffer.length()==11) { Buffer=Buffer.substring(1, Buffer.length()); } try { c = html.read(); } catch (IOException ex) { } Buffer+=(char)c; Code+=(char)c; } } Buffer=Buffer.substring(1, Buffer.length()); } } return Code.substring(0, Code.length()-11); } }