VB Paste by zaza95
Description: MTPI
Hide line numbers

Create new paste
Post a reply
View replies

Paste:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
Imports System.IO.Directory
Public Class Form1

    Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
        OpenFileDialog1.ShowDialog()
    End Sub

    Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
        TextBox1.Text = OpenFileDialog1.InitialDirectory + OpenFileDialog1.FileName
        TextBox2.Text = "C:\Users\" + System.Environment.UserName + "\AppData\Roaming\.minecraft\resourcepacks\" + OpenFileDialog1.SafeFileName
        Dim filename As String
        filename = OpenFileDialog1.FileName
        Dim msgbox As String
        msgbox = "You've succesfuly installed the " + filename + " texturepack."
    End Sub

    Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
        Dim filename As String
        filename = OpenFileDialog1.SafeFileName
        Dim msbox As String
        msbox = "You've succesfuly installed the " + filename + " texturepack."

        If My.Computer.FileSystem.DirectoryExists("C:\Users\" + System.Environment.UserName + "\AppData\Roaming\.minecraft\resourcepacks") And My.Computer.FileSystem.FileExists(TextBox2.Text) Then
            MsgBox("There is already a texturepack with that name do you want to override it?", MsgBoxStyle.YesNo)
            Select Case MsgBox("Are you sure ?", MsgBoxStyle.YesNo, "Delete")
                Case MsgBoxResult.Yes
                    My.Computer.FileSystem.DeleteFile(TextBox2.Text)
                    My.Computer.FileSystem.MoveFile(TextBox1.Text, TextBox2.Text)
                    MsgBox(msbox, MsgBoxStyle.Information)
                Case MsgBoxResult.No
                    MsgBox("Process aborted")
            End Select
        ElseIf My.Computer.FileSystem.DirectoryExists("C:\Users\" + System.Environment.UserName + "\AppData\Roaming\.minecraft\resourcepacks") Then
            My.Computer.FileSystem.MoveFile(TextBox1.Text, TextBox2.Text)
            MsgBox(msbox, MsgBoxStyle.Information)
        Else
            MsgBox("It seems like you're missing the 'resourcepacks' folder.Try Starting/Restarting 'Minecraft' and try again.")
        End If

    End Sub

    Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
        Process.Start("http://www.planetminecraft.com/member/zaza95/")
    End Sub
End Class

Replies:
No replies posted yet