Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class Form1
- Dim dlthread As Threading.Thread
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim webClient As New System.Net.WebClient
- Dim result As String = webClient.DownloadString("https://dl.dropbox.com/u/88613681/version.txt")
- MsgBox("You have Snapshot " + result)
- Control.CheckForIllegalCrossThreadCalls = False
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- dlthread = New Threading.Thread(AddressOf dl)
- dlthread.Start()
- End Sub
- Private Sub dl()
- Dim webClient As New System.Net.WebClient
- Dim result As String = webClient.DownloadString("https://dl.dropbox.com/u/88613681/version.txt")
- Dim i As Integer
- If TextBox1.Text = "" Then
- MsgBox("Please fill in your IGN", vbOKOnly, "Snaploader")
- Exit Sub
- End If
- MsgBox("Warning! This will replace your current minecraft.jar! ", vbOKOnly, "SnapLoader")
- Try
- My.Computer.Network.Ping("1.1.1.1")
- Label2.ForeColor = Color.Green
- Label2.Text = "Status - DL found!"
- Label2.Refresh()
- Threading.Thread.Sleep(2000)
- i = i + 1
- Catch ex As Exception
- Label2.Refresh()
- Label2.ForeColor = Color.Red
- Label2.Text = "Status - Failed!"
- Threading.Thread.Sleep(3000)
- Label2.ForeColor = Color.Black
- Label2.Text = "Status - Idling"
- End Try
- If i = 1 Then
- Label2.Refresh()
- Label2.Text = "Status - Fetching."
- Threading.Thread.Sleep(2000)
- Label2.Refresh()
- Label2.ForeColor = Color.Red
- Label2.Text = "Status - Error!"
- Threading.Thread.Sleep(2000)
- Label2.ForeColor = Color.Green
- Label2.Text = "Status - Fetching.."
- Threading.Thread.Sleep(2000)
- Label2.Text = "Status - Fetching..."
- Threading.Thread.Sleep(1550)
- Label2.Text = "Status - Fetched"
- Threading.Thread.Sleep(2000)
- Label2.Text = "Status - DLing"
- Dim lala As String
- lala = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
- Dim filepath As String
- filepath = lala + "\.minecraft\bin\minecraft.jar"
- Try
- If File.Exists(filepath) Then
- File.Delete(filepath)
- Else
- My.Computer.Network.DownloadFile("http://assets.minecraft.net/" + result + "/minecraft.jar", filepath)
- End If
- Catch e As Exception
- MsgBox("Error while downloading minecraft jar file! " + e.Message)
- End Try
- Dim filepath2 As String
- filepath2 = lala + "\.minecraft\Minecraft.exe"
- Try
- If File.Exists(filepath2) Then
- File.Delete(filepath2)
- Else
- My.Computer.Network.DownloadFile("https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe", filepath2)
- Threading.Thread.Sleep(1500)
- End If
- Catch e As Exception
- MsgBox("Error while downloading minecraft launcher! " + e.Message)
- End Try
- Threading.Thread.Sleep(10000)
- Label2.ForeColor = Color.Black
- Label2.Text = "Status - Moving File"
- Threading.Thread.Sleep(2000)
- MsgBox("You can now launch minecraft to play the latest snapshot!", vbOKOnly, "SnapLoader")
- Label2.Text = "Status - Idling"
- End If
- End Sub
- Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
- 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")
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment