Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hi leute,

hab hier ein folgendes Problem:

Ich will eine Datei kompriemieren nur weiß ich jetzt nicht wie ich beim Gzipstream dessen standartcompressionsrate auf 0 ist diese auf das maximum welches 9 ist zu stellen.

Hier ist der momentane Funktion zum comprimieren:


 Public Function ZipFile(ByVal sFile As String, Optional ByVal sZipFile As String = "") As Boolean

        Try

            If System.IO.File.Exists(sFile) Then

                If sZipFile.Length = 0 Then

                    With New System.IO.FileInfo(sFile)

                        sZipFile = .DirectoryName

                        If Not sZipFile.EndsWith("\") Then sZipFile += "\"

                        sZipFile += .Name.Substring(0, .Name.Length - .Extension.Length) & ".gzip"

                    End With

                End If


                Dim oStream As System.IO.FileStream

                oStream = New System.IO.FileStream(sFile, IO.FileMode.Open)

                Dim bBuffer(oStream.Length - 1) As Byte

                With oStream

                    .Read(bBuffer, 0, bBuffer.Length)

                    .Close()

                End With


                ' Jetzt Daten komprimieren und in Zieldatei speichern

                oStream = New System.IO.FileStream(sZipFile, IO.FileMode.Create)

                Dim oCompress As New System.IO.Compression.GZipStream( _

                  oStream, IO.Compression.CompressionMode.Compress)

                With oCompress

                    .Write(bBuffer, 0, bBuffer.Length)

                    .Flush()

                    .Close()

                End With

                oStream.Close()

            End If

            Return True

        Catch

            Return False

        End Try

    End Function

Mfg

Gateway

Hi Gateway_man,

muss es zwingend über Gzipstream sein? Sonst kannst du doch auch 7zip als commandline version ausführen und darin zippen.

Lässt sich meines wissens auch einstellen, wie groß die Kommpression sein soll

Gruß

noob

Hallo,

hatte das gleiche Problem, hab eine gute Komponente vom Microsoft-Interop-Team gefunden : DotNetZip Library - Home

Beispiele sind leicht verständlich und die Komponente ist auch im Gesamten sehr einfach anzuwenden.

  • Autor
Hi Gateway_man,

muss es zwingend über Gzipstream sein? Sonst kannst du doch auch 7zip als commandline version ausführen und darin zippen.

Lässt sich meines wissens auch einstellen, wie groß die Kommpression sein soll

Gruß

noob

Nein es muss nicht unbedingt der Gzipstream sein, jedoch sollte es bei möglichkeit eine Bibliothek sein, welche ich in meine Application als Verweis integrieren kann. Deine Alternative macht mich wieder total abhängig, da man dann immer 7zip installiert haben müsste.

@ chrixko:

Danke scheint was brauchbares zu sein, werds bei Zeit mal anschaun.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.