Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem]Pomoże ktoś z kodem do launchera?


Rekomendowane odpowiedzi

Opublikowano
Imports System.Net.Sockets
Imports System.Net
Imports System.Environment
Imports System.IO
Imports System.Text.RegularExpressions


Public Class Form1
    Dim WithEvents WC As New WebClient
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If CheckBox1.Checked Then
            Dim folder As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels/logowanie.txt")
            Dim sw As New System.IO.StreamWriter(folder)
            sw.WriteLine(TextBox1.Text)
            sw.WriteLine(TextBox2.Text)
            sw.Close()
        ElseIf CheckBox1.Checked = False Then
            Dim folder As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels/logowanie.txt")
            If System.IO.File.Exists(folder) Then
                Kill(folder)
            End If
        End If
        Dim launch As String
        launch = "start javaw -Xmx" & TextBox2.Text & "m -Djava.library.path=%appdata%/mcrebels/versions/natives -cp %appdata%/mcrebels/libraries/1.7.2/vecmath-1.3.1.jar;%appdata%/mcrebels/libraries/1.7.2/trove4j-3.0.3.jar;%appdata%/mcrebels/libraries/1.7.2/icu4j-core-mojang-51.2.jar;%appdata%/mcrebels/libraries/1.7.2/jopt-simple-4.5.jar;%appdata%/mcrebels/libraries/1.7.2/codecjorbis-20101023.jar;%appdata%/mcrebels/libraries/1.7.2/codecwav-20101023.jar;%appdata%/mcrebels/libraries/1.7.2/libraryjavasound-20101123.jar;%appdata%/mcrebels/libraries/1.7.2/librarylwjglopenal-20100824.jar;%appdata%/mcrebels/libraries/1.7.2/soundsystem-20120107.jar;%appdata%/mcrebels/libraries/1.7.2/netty-all-4.0.9.Final.jar;%appdata%/mcrebels/libraries/1.7.2/guava-14.0.jar;%appdata%/mcrebels/libraries/1.7.2/commons-lang3-3.1.jar;%appdata%/mcrebels/libraries/1.7.2/commons-io-2.4.jar;%appdata%/mcrebels/libraries/1.7.2/jinput-2.0.5.jar;%appdata%/mcrebels/libraries/1.7.2/jutils-1.0.0.jar;%appdata%/mcrebels/libraries/1.7.2/gson-2.2.2.jar;%appdata%/mcrebels/libraries/1.7.2/authlib-1.1.jar;%appdata%/mcrebels/libraries/1.7.2/log4j-api-2.0-beta9.jar;%appdata%/mcrebels/libraries/1.7.2/log4j-core-2.0-beta9.jar;%appdata%/mcrebels/libraries/1.7.2/lwjgl-2.9.0.jar;%appdata%/mcrebels/libraries/1.7.2/lwjgl_util-2.9.0.jar;%appdata%/mcrebels/versions/1.7.2/1.7.2.jar"
        Shell("cmd.exe /c" & launch & TextBox1.Text)
        Me.Close()
        If TextBox1.Text = "" Then
            MsgBox("Wpisz nick")
            Return
        End If
        If TextBox2.Text = "" Then
            MsgBox("Wpisz Ilosc Ramu")
            Return
        End If
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ProgressBar1.Hide()
        Label4.Hide()
        Label5.Hide()
        Dim folder2 As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels/sprawdz.txt")
        If System.IO.File.Exists(folder2) Then
            Button1.Enabled = True
        Else
            Button1.Enabled = False
            MsgBox("Nie masz zainstalowanego MCRebels. Pobierz folder używając przycisku: Aktulizuj, a nastepnie zainstaluj go przyciskiem Zainstaluj .Miłej gry życzy Team Rebels.pl")
        End If

        Dim wypakuj As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels.zip")
        If System.IO.File.Exists(wypakuj) Then
            Button2.Enabled = True
        Else
            Button2.Enabled = False
        End If
        Dim folder As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels/logowanie.txt")
        If System.IO.File.Exists(folder) Then


            Dim sr As New System.IO.StreamReader(folder)
            TextBox1.Text = sr.ReadLine
            TextBox2.Text = sr.ReadLine
            sr.Close()


        End If

        Dim folder3 As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels/wersja.txt")
        If System.IO.File.Exists(folder3) Then
            Dim sr As New System.IO.StreamReader(folder3)
            Label7.Text = sr.ReadLine
            sr.Close()
        Else
            My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "mcrebels/wersja.txt")
            Dim sw As New System.IO.StreamWriter(folder3)
            sw.WriteLine("0.0.0")
            sw.Close()

        End If





    End Sub



    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim client As New Net.WebClient
        Dim folder3 As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels\wersja.txt")
        Dim spr As String = My.Computer.FileSystem.ReadAllText(folder3)
        Dim nowawersja As String = client.DownloadString("https://dl.dropboxusercontent.com/s/hqaswqdk1cgefd9/wersja.txt?dl=1&token_hash=AAHtUarjhZ7xvE9rFWmoPDNb9mR4d9B0iqaYO3BDVMxaHg")
        If nowawersja > spr Then
            If MsgBox("Chcesz pobrac nowa wersje?", vbQuestion + vbYesNo, "Wersja") = vbYes Then
                Label9.Hide()
                ProgressBar1.Show()
                Label5.Show()
                Label4.Show()
                Dim folder4 As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "mcrebels.zip")

                Dim appData As String = GetFolderPath(SpecialFolder.ApplicationData)
                WC.DownloadFileAsync(New Uri("https://dl.dropboxusercontent.com/s/oqvqkuc13u57uv6/mcrebels.zip?dl=1&token_hash=AAEv-mTYfUxTf5OpfcXaj__Ky-lOI2u0VxIVoFw7urGwgw"), appData & "mcrebels.zip")
                Button4.Text = "Pobieranie"
                Button4.Enabled = False



            Else
                MsgBox("Nowa wersja to: " & nowawersja)
            End If
        End If

    End Sub
    Private Sub WC_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WC.DownloadProgressChanged
        ProgressBar1.Value = e.ProgressPercentage

        If ProgressBar1.Value = 100 Then
            MsgBox("Pobrano plik")
            Button4.Text = "Sprawdź wersję"
            Button4.Enabled = True
            ProgressBar1.Hide()
        End If
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Label9.Hide()

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick


    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim appData As String = GetFolderPath(SpecialFolder.ApplicationData)
        Unzip(appData & "mcrebels.zip", appData)

    End Sub
End Class

Pomóżcie

400x60-1.gif

Opublikowano

Powiedz dokładniej o co ci chodzi :)

Proszę o cytowanie moich postów jeżeli kierujesz odpowiedź w moją stronę. Dziękuje!

  • 2 tygodnie później...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...