123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- Imports System
- Imports System.IO
- Public Class Form3
- Dim appPath As String = Application.StartupPath()
- Private IsFormBeingDragged As Boolean = False
- Private MouseDownX As Integer
- Private MouseDownY As Integer
- Dim z As String
- Private Sub Form3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- For counter = 10 To 90 Step +20
- Me.Opacity = counter / 100
- Me.Refresh()
- Threading.Thread.Sleep(50)
- Next
- Me.Opacity = 100
-
- For Each Dir As String In Directory.GetDirectories(appPath & "\system\minecraft")
- Dim filePath As String = Dir
- Dim split As String() = filePath.Split("\")
- Dim parentFolder As String = split(split.Length - 1)
- ListBox1.Items.Add(parentFolder)
- Dim countfolder As Integer
- Dim dire() As String = System.IO.Directory.GetDirectories(appPath & "\system\minecraft\")
- countfolder = dire.Length
- If countfolder = 1 Then
- If My.Computer.FileSystem.FileExists(appPath & "\system\" & parentFolder & ".bat") Then
- Shell(appPath & "\system\" & parentFolder & ".bat", vbHide)
- Threading.Thread.Sleep(3000)
- Dim iCount As Integer
- For iCount = 90 To 10 Step -10
- Me.Opacity = iCount / 100
- Threading.Thread.Sleep(50)
- Next
- Me.Close()
- ElseIf My.Computer.FileSystem.FileExists(appPath & "\system\" & parentFolder & ".bat") = False Then
- Label1.Text = "請先為 " & parentFolder & "版本設置玩家名稱"
- Else
- Label1.Text = "請到遊戲設置設定玩家名稱"
- End If
- ElseIf countfolder = 0 Then
- Label1.Text = "請使用自動更新功能下載客戶端文件"
- Else
- Label1.Text = "請選擇要啟動的版本"
- End If
- Next
- End Sub
- Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown
- If e.Button = MouseButtons.Left Then
- IsFormBeingDragged = True
- MouseDownX = e.X
- MouseDownY = e.Y
- End If
- End Sub
- Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseUp
- If e.Button = MouseButtons.Left Then
- IsFormBeingDragged = False
- End If
- End Sub
- Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseMove
- If IsFormBeingDragged Then
- Dim temp As Point = New Point()
- temp.X = Me.Location.X + (e.X - MouseDownX)
- temp.Y = Me.Location.Y + (e.Y - MouseDownY)
- Me.Location = temp
- temp = Nothing
- End If
- End Sub
- Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim iCount As Integer
- For iCount = 90 To 10 Step -10
- Me.Opacity = iCount / 100
- Threading.Thread.Sleep(50)
- Next
- Me.Close()
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If My.Computer.FileSystem.FileExists(appPath & "\system\" & ListBox1.SelectedItem & ".bat") = False Then
- Label1.Text = "請先為 " & ListBox1.SelectedItem & "版本設置玩家名稱"
- Else
- Try
- Shell(appPath & "\system\" & ListBox1.SelectedItem & ".bat", vbHide)
- Dim iCount As Integer
- For iCount = 90 To 10 Step -10
- Me.Opacity = iCount / 100
- Threading.Thread.Sleep(50)
- Next
- Me.Close()
- Catch ex As Exception
- Label3.Text = ex.Message & "請選擇版本或下載更新。"
- End Try
- End If
- End Sub
- End Class
|