h31ix

Untitled

Mar 6th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public static void getip()
  2. {
  3. try {
  4. URL URL = new URL("http://www.whatismyip.org/");
  5.  
  6. HttpURLConnection Conn = (HttpURLConnection)URL.openConnection();
  7.  
  8. InputStream InStream = Conn.getInputStream();
  9.  
  10. InputStreamReader Isr = new InputStreamReader(InStream);
  11.  
  12. BufferedReader Br = new BufferedReader(Isr);
  13. ip = Br.readLine();
  14. } catch (Exception e) {
  15. e.printStackTrace();
  16. }
  17. }
  18.  
  19. public static void logit() throws IOException {
  20. try {
  21. URL URL = new URL("http://yourfunworld.co.cc/bukkit/plugins/mybarrier/scripts/log/index.php?ip=" + ip + "&port=" + Bukkit.getPort());
  22. HttpURLConnection Conn = (HttpURLConnection)URL.openConnection();
  23.  
  24. InputStream InStream = Conn.getInputStream();
  25.  
  26. InputStreamReader Isr = new InputStreamReader(InStream);
  27.  
  28. Br = new BufferedReader(Isr);
  29. }
  30. catch (MalformedURLException e)
  31. {
  32. BufferedReader Br;
  33. e.printStackTrace();
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment