Hi,
ich habe gestern im Google mal zeugs eigetippt und bin auf dies hier gestossen:
Der Fehler kommt beim entpacken (Siehe Anhang)
ich habe gestern im Google mal zeugs eigetippt und bin auf dies hier gestossen:
VB.NET-Quellcode
- Imports RARNET
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim dlg As OpenFileDialog = New OpenFileDialog()
- dlg.Title = "Unpack RAR Archive"
- dlg.CheckFileExists = True
- dlg.DefaultExt = "RAR"
- dlg.Filter = "RAR files (*.rar)|*.rar"
- Dim res As DialogResult = dlg.ShowDialog()
- If res = DialogResult.OK Then
- TextBox1.Text = dlg.FileName
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- If TextBox1.TextLength < 1 Then Exit Sub
- If TextBox2.TextLength < 1 Then Exit Sub
- TextBox1.Enabled = False
- TextBox2.Enabled = False
- Button1.Enabled = False
- Button2.Enabled = False
- Dim d As New Decompressor(TextBox1.Text)
- AddHandler d.OnUnpack, AddressOf Unpacked
- AddHandler d.Unpacking, AddressOf InProgress
- d.UnPackAll(TextBox2.Text)
- End Sub
- Public Sub Unpacked(ByVal r As Decompressor.RAREntry)
- ToolStripLabel1.Visible = True
- ToolStripLabel1.Text = "Unpacked: " & r.FileName
- ' If u want to shorten the text and add "..."
- If ToolStripLabel1.Text.Length > 28 Then
- ToolStripLabel1.Text = ToolStripLabel1.Text.Substring(0, 28) + "..."
- End If
- End Sub
- Public Sub InProgress(ByVal fTotalFileSize As Long, ByVal fUnpacked As Long, ByRef Disposition As RARNET.Decompressor.RarDisposition)
- If fTotalFileSize = 0 Then Exit Sub
- ToolStripLabel2.Text = Format(fUnpacked / fTotalFileSize, "percent")
- ToolStripProgressBar1.Value = CInt(CDbl(Format(fUnpacked / fTotalFileSize)) * 100)
- Me.Refresh()
- End Sub
- Public Sub GetPath()
- Dim dlg2 As FolderBrowserDialog = New FolderBrowserDialog()
- Dim res2 As DialogResult = dlg2.ShowDialog()
- If res2 = DialogResult.OK Then
- TextBox2.Text = dlg2.SelectedPath
- End If
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- If Not System.IO.File.Exists(Application.StartupPath & "\unrar.dll") Then
- MsgBox("Missing unpacking dll...")
- Application.Exit()
- End If
- ToolStripLabel1.Visible = False
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- GetPath()
- End Sub
- End Class
Der Fehler kommt beim entpacken (Siehe Anhang)