Guest User

SnapLoader SRC

a guest
Oct 20th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.IO
  2.  
  3. Public Class Form1
  4.     Dim dlthread As Threading.Thread
  5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         Dim webClient As New System.Net.WebClient
  7.         Dim result As String = webClient.DownloadString("https://dl.dropbox.com/u/88613681/version.txt")
  8.         MsgBox("You have Snapshot " + result)
  9.         Control.CheckForIllegalCrossThreadCalls = False
  10.     End Sub
  11.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  12.         dlthread = New Threading.Thread(AddressOf dl)
  13.         dlthread.Start()
  14.     End Sub
  15.     Private Sub dl()
  16.         Dim webClient As New System.Net.WebClient
  17.         Dim result As String = webClient.DownloadString("https://dl.dropbox.com/u/88613681/version.txt")
  18.         Dim i As Integer
  19.        
  20.         If TextBox1.Text = "" Then
  21.             MsgBox("Please fill in your IGN", vbOKOnly, "Snaploader")
  22.             Exit Sub
  23.         End If
  24.         MsgBox("Warning! This will replace your current minecraft.jar! ", vbOKOnly, "SnapLoader")
  25.         Try
  26.             My.Computer.Network.Ping("1.1.1.1")
  27.             Label2.ForeColor = Color.Green
  28.             Label2.Text = "Status - DL found!"
  29.             Label2.Refresh()
  30.             Threading.Thread.Sleep(2000)
  31.             i = i + 1
  32.         Catch ex As Exception
  33.             Label2.Refresh()
  34.             Label2.ForeColor = Color.Red
  35.             Label2.Text = "Status - Failed!"
  36.             Threading.Thread.Sleep(3000)
  37.             Label2.ForeColor = Color.Black
  38.             Label2.Text = "Status - Idling"
  39.         End Try
  40.         If i = 1 Then
  41.             Label2.Refresh()
  42.             Label2.Text = "Status - Fetching."
  43.             Threading.Thread.Sleep(2000)
  44.             Label2.Refresh()
  45.             Label2.ForeColor = Color.Red
  46.             Label2.Text = "Status - Error!"
  47.             Threading.Thread.Sleep(2000)
  48.             Label2.ForeColor = Color.Green
  49.             Label2.Text = "Status - Fetching.."
  50.             Threading.Thread.Sleep(2000)
  51.             Label2.Text = "Status - Fetching..."
  52.             Threading.Thread.Sleep(1550)
  53.             Label2.Text = "Status - Fetched"
  54.             Threading.Thread.Sleep(2000)
  55.             Label2.Text = "Status - DLing"
  56.             Dim lala As String
  57.             lala = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
  58.             Dim filepath As String
  59.             filepath = lala + "\.minecraft\bin\minecraft.jar"
  60.             Try
  61.                 If File.Exists(filepath) Then
  62.                     File.Delete(filepath)
  63.                 Else
  64.                     My.Computer.Network.DownloadFile("http://assets.minecraft.net/" + result + "/minecraft.jar", filepath)
  65.                 End If
  66.             Catch e As Exception
  67.                 MsgBox("Error while downloading minecraft jar file! " + e.Message)
  68.             End Try
  69.             Dim filepath2 As String
  70.             filepath2 = lala + "\.minecraft\Minecraft.exe"
  71.             Try
  72.                 If File.Exists(filepath2) Then
  73.                     File.Delete(filepath2)
  74.                 Else
  75.                     My.Computer.Network.DownloadFile("https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe", filepath2)
  76.                     Threading.Thread.Sleep(1500)
  77.                 End If
  78.             Catch e As Exception
  79.                 MsgBox("Error while downloading minecraft launcher! " + e.Message)
  80.             End Try
  81.             Threading.Thread.Sleep(10000)
  82.             Label2.ForeColor = Color.Black
  83.             Label2.Text = "Status - Moving File"
  84.             Threading.Thread.Sleep(2000)
  85.             MsgBox("You can now launch minecraft to play the latest snapshot!", vbOKOnly, "SnapLoader")
  86.             Label2.Text = "Status - Idling"
  87.  
  88.         End If
  89.  
  90.     End Sub
  91.     Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
  92.         MsgBox("We are currently doing a survey as to who uses this program, all we ask is you put your minecraft name in the box. We do not use your name in any way shape or form, it is just a guide for us.", vbOKOnly, "Snaploader")
  93.     End Sub
  94. End Class
Advertisement
Add Comment
Please, Sign In to add comment