Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String str = "";
- String readText ="0";
- try {
- // Create a URL for the desired page
- URL url = new URL("http://dl.canarymod.net:80/version.txt");
- // Read all the text returned by the server
- BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
- while ((str = in.readLine()) != null) {
- readText = str;
- }
- in.close();
- } catch (MalformedURLException e) {
- } catch (IOException e) {
- }
- if (etc.getInstance().getVersion() == Integer.parseInt(readText))
- log("Thank you for running the latest version of Canary");
- else
- 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