Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //You need to be running java 7 I believe!
- String ip; //where ip will be saved
- try {
- BufferedReader in = new BufferedReader(new InputStreamReader(new URL("http://jackhallam.net/checkip.php").openStream()));
- ip = in.readLine().split("<")[0];
- in.close();
- }
- catch (Exception e) {
- //Handle no ip found
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement