SkyeDarkhawk

Main.java @CanaryMod.jar

May 9th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. String str = "";
  2.         String readText ="0";
  3.         try {
  4.     // Create a URL for the desired page
  5.     URL url = new URL("http://dl.canarymod.net:80/version.txt");
  6.  
  7.     // Read all the text returned by the server
  8.     BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
  9.     while ((str = in.readLine()) != null) {
  10.         readText = str;
  11.     }
  12.     in.close();
  13. } catch (MalformedURLException e) {
  14. } catch (IOException e) {
  15. }
  16.         if (etc.getInstance().getVersion() == Integer.parseInt(readText))
  17.             log("Thank you for running the latest version of Canary");
  18.         else
  19.             log("There is an updated version of Canary available at http://dl.canarymod.net/get.php?v=latest");
Advertisement
Add Comment
Please, Sign In to add comment