In der all datei kommt das wenn ich es öffne :
Dort kann ich aber nirgents rechtlick und erstellen ? >.<
Imports System.IO
Imports System.Drawing
Imports System.Threading
Imports System.Windows.Forms
Public Class PatchListCreator
Dim sLine As String ' Für die Zeilen der Textdatei
Dim MaxLine As Array ' Für die Zeilen der Textdatei
Dim oStream As IO.StreamReader ' Zum auslesen der Textdatei
#Region "Form"
' Form Bewegen
Private ptMouseDownLocation As Point
Private Sub f_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
ptMouseDownLocation = e.Location
End If
End Sub
Private Sub f_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Location = e.Location - ptMouseDownLocation + Me.Location
End If
End Sub
Private Sub PatchListCreator_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Icon = My.Resources.icon
TextBox1.Text = My.Settings.RootPath
End Sub
#End Region
#Region "Button"
' Exit Button
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
If TextBox1.Text <> "" And Directory.Exists(TextBox1.Text) Then
My.Settings.RootPath = TextBox1.Text
My.Settings.Save()
End If
If IO.File.Exists("gzip.exe") Then IO.File.Delete("gzip.exe")
Me.Close()
End Sub
Private Sub Label1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseLeave
Label1.Image = Nothing
End Sub
Private Sub Label1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseMove
Label1.Image = My.Resources.X
End Sub
#End Region
#Region "Textbox"
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If Directory.Exists(TextBox1.Text) Then
Button1.Enabled = True
Button2.Enabled = True
Button3.Enabled = True
Else
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
End If
End Sub
#End Region
#Region "Button"
Private Sub Button(ByVal bool As Boolean)
Button1.Enabled = bool
Button2.Enabled = bool
Button3.Enabled = bool
End Sub
' Compress
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button(False)
Dim Path As String = My.Computer.FileSystem.SpecialDirectories.Temp 'Application.StartupPath
Dim content As String = "dir " & Ansi() & TextBox1.Text & Ansi() & " /B /S > " & Ansi() & Path & "\list.txt" & Ansi()
If File.Exists(Path & "\list.bat") Then
File.Delete(Path & "\list.bat")
End If
File.AppendAllText(Path & "\list.bat", content)
Process.Start(Path & "\list.bat")
Thread.Sleep(200)
File.Delete(Path & "\list.bat")
Do Until File.Exists(Path & "list.txt") : Loop
oStream = New StreamReader(Path & "\list.txt") 'Datei zum lesen auswählen
MaxLine = File.ReadAllLines(Path & "\list.txt")
If Not File.Exists("gzip.exe") Then
File.WriteAllBytes("gzip.exe", My.Resources.gzip)
delay(1000)
End If
Dim count As Int32 = 0
Do
Do While Process.GetProcessesByName("gzip").Length > MAX_GZIP
' warten
Loop
sLine = oStream.ReadLine() ' Zeile lesen
Try
Dim fi As New FileInfo(sLine)
Dim p As New Process
If Not sLine.EndsWith(".gz") And Not sLine.Contains("list.txt") And Not sLine.Contains("NewPatcher.exe") Then
count += 1
Label4.Text = count & "/" & MaxLine.Length
p.StartInfo.FileName = "gzip.exe"
p.StartInfo.Arguments = "-f -q " & Ansi() & sLine & Ansi()
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
p.Start()
End If
Application.DoEvents()
Catch : End Try
Loop Until oStream.EndOfStream
oStream.Close()
If File.Exists(Path & "\list.txt") Then
File.Delete(Path & "\list.txt")
End If
Do While Process.GetProcessesByName("gzip").Length > 0
' warten
Loop
Label4.Text = "Finished"
Button(True)
End Sub
' Decompress
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Button(False)
Dim Path As String = My.Computer.FileSystem.SpecialDirectories.Temp 'Application.StartupPath
Dim content As String = "dir " & Ansi() & TextBox1.Text & Ansi() & " /B /S > " & Ansi() & Path & "\list.txt" & Ansi()
If File.Exists(Path & "\list.bat") Then
File.Delete(Path & "\list.bat")
End If
File.AppendAllText(Path & "\list.bat", content)
Process.Start(Path & "\list.bat")
Thread.Sleep(200)
File.Delete(Path & "\list.bat")
Do Until File.Exists(Path & "list.txt") : Loop
oStream = New StreamReader(Path & "\list.txt") 'Datei zum lesen auswählen
MaxLine = File.ReadAllLines(Path & "\list.txt")
If Not File.Exists("gzip.exe") Then
File.WriteAllBytes("gzip.exe", My.Resources.gzip)
delay(1000)
End If
Dim count As Int32 = 0
Do
Do While Process.GetProcessesByName("gzip").Length > MAX_GZIP
' warten
Loop
sLine = oStream.ReadLine() ' Zeile lesen
Try
Dim fi As New IO.FileInfo(sLine)
Dim p As New Process
If sLine.EndsWith(".gz") Then
count += 1
Label4.Text = count & "/" & MaxLine.Length
p.StartInfo.FileName = "gzip.exe"
p.StartInfo.Arguments = "-f -q -d " & Ansi() & sLine & Ansi()
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
p.Start()
End If
Catch : End Try
Application.DoEvents()
Loop Until oStream.EndOfStream
oStream.Close()
If File.Exists(Path & "\list.txt") Then
File.Delete(Path & "\list.txt")
End If
Do While Process.GetProcessesByName("gzip").Length > 0
' warten
Loop
Label4.Text = "Finished"
Button(True)
End Sub
' Create List
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Button(False)
Dim Path As String = My.Computer.FileSystem.SpecialDirectories.Temp 'Application.StartupPath
Dim content As String = "dir " & Ansi() & TextBox1.Text & Ansi() & " /B /S > " & Ansi() & Path & "\list.txt" & Ansi()
If File.Exists(Path & "\list.bat") Then
File.Delete(Path & "\list.bat")
End If
If File.Exists(TextBox1.Text & "\list.txt") Then
File.Delete(TextBox1.Text & "\list.txt")
End If
File.AppendAllText(Path & "\list.bat", content)
Thread.Sleep(200)
Process.Start(Path & "\list.bat")
Thread.Sleep(200)
File.Delete(Path & "\list.bat")
Do Until File.Exists(Path & "list.txt") : Loop
oStream = New StreamReader(Path & "\list.txt") 'Datei zum lesen auswählen
MaxLine = File.ReadAllLines(Path & "\list.txt")
Dim count As Int32 = 0
Dim output As String = "VER: " & VER & vbNewLine
Do
count += 1
sLine = oStream.ReadLine() ' Zeile lesen
If Not sLine.Contains("NewPatcher.exe") And Not sLine.Contains("list.txt") Then
Try
Dim fi As New FileInfo(sLine)
Dim str As String = sLine.Replace(TextBox1.Text & "\", Nothing) & ".gz"
str &= "|" & fi.Length.ToString
If USE_MD5 Then
str &= "|" & FileMd5(sLine)
End If
output &= vbNewLine & Crypt(str)
Label4.Text = count & "/" & MaxLine.Length
Application.DoEvents()
Catch : End Try
End If
Loop Until oStream.EndOfStream
oStream.Close()
If File.Exists(TextBox1.Text & "\list.txt") Then
File.Delete(TextBox1.Text & "\list.txt")
Thread.Sleep(200)
End If
If File.Exists(Path & "\list.txt") Then
File.Delete(Path & "\list.txt")
Thread.Sleep(200)
End If
File.AppendAllText(TextBox1.Text & "\list.txt", output)
Label4.Text = "Finished"
Button(True)
End Sub
#End Region
End Class