try {
for(int i=340;;i++) {
URL url = new URL("http://www.645lotto.net/Confirm/number.asp?sltSeq="+i);
Reader r = new InputStreamReader(url.openStream());
BufferedReader br = new BufferedReader(r);
String prefix = "<img src=\"../images/Comm/s";
String number = "";
String t;
while((t = br.readLine()) != null) {
if(t.indexOf(prefix) > -1) {
String num = t.trim().substring(prefix.length(), prefix.length() + 2);
if(!num.equals("pl")) number += (number.equals("") ? "" : ",") + num;
}
}
if(number.equals("")) break;
System.out.println(i + " -> " + number);
}
} catch (Exception e) {
e.printStackTrace();
}
for(int i=340;;i++) {
URL url = new URL("http://www.645lotto.net/Confirm/number.asp?sltSeq="+i);
Reader r = new InputStreamReader(url.openStream());
BufferedReader br = new BufferedReader(r);
String prefix = "<img src=\"../images/Comm/s";
String number = "";
String t;
while((t = br.readLine()) != null) {
if(t.indexOf(prefix) > -1) {
String num = t.trim().substring(prefix.length(), prefix.length() + 2);
if(!num.equals("pl")) number += (number.equals("") ? "" : ",") + num;
}
}
if(number.equals("")) break;
System.out.println(i + " -> " + number);
}
} catch (Exception e) {
e.printStackTrace();
}
'Java' 카테고리의 다른 글
pc 캠 화면 JFrame 에 출력하기 (1) | 2010.04.09 |
---|---|
java socket 통신 (2) | 2010.04.07 |
openCsv sample function (2) | 2010.04.07 |
AES java 암호화 구현 function sample (1) | 2010.04.07 |
Unzip.java (3) | 2010.04.07 |