Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all articles
Browse latest Browse all 239

New Post: Increase File Extraction Speed VB.net

$
0
0
Hi All
I would like to know if there is a way for me to increase the speed of the decompressor on sharpcompress I have looked through the forums and can't find what I'm looking for I'm using Visual Basic.net and here is the code I am using to extract the files it uses the Background Worker tool

Code:
        BackgroundWorker1.ReportProgress(0)
        System.Threading.Thread.Sleep(1)

        'Extract Archive In The Background So Application Wont Freeze
        Dim archive As IArchive = ArchiveFactory.Open(OFD.FileName)
        For Each entry In archive.Entries

            If Not entry.IsDirectory Then
                Console.WriteLine(entry.FilePath)
                entry.WriteToDirectory(My.Application.Info.DirectoryPath & "\Mods\", ExtractOptions.ExtractFullPath Or ExtractOptions.Overwrite)

            End If
        Next
        If My.Computer.FileSystem.DirectoryExists(My.Application.Info.DirectoryPath & "\Mods\" & My.Settings.NewModName) Then
            Message = MsgBox(My.Settings.NewModName & " Already Exsists Do You Want To Overight The Directory? Selecting No Will Terminate Mod Extraction", MsgBoxStyle.YesNo, "Mod Already Exsists")
            If Message = MsgBoxResult.No Then
                My.Computer.FileSystem.DeleteDirectory(My.Application.Info.DirectoryPath & "\Mods\" & My.Settings.Orignal_Name, FileIO.DeleteDirectoryOption.DeleteAllContents, FileIO.RecycleOption.DeletePermanently)
            Else
                My.Computer.FileSystem.DeleteDirectory(My.Application.Info.DirectoryPath & "\Mods\" & My.Settings.NewModName, FileIO.DeleteDirectoryOption.DeleteAllContents, FileIO.RecycleOption.DeletePermanently)
                My.Computer.FileSystem.RenameDirectory(My.Application.Info.DirectoryPath & "\Mods\" & My.Settings.Orignal_Name, My.Settings.NewModName)

            End If

        End If
        My.Computer.FileSystem.RenameDirectory(My.Application.Info.DirectoryPath & "\Mods\" & My.Settings.Orignal_Name, My.Settings.NewModName)
If anyone can help me speed up the decompressor I would be very happy given me a headache trying to work this one out. :)

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>