Страница: 1 |
Вопрос: ZIP - архивирование | Добавлено: 20.11.06 23:44 |
Автор вопроса: ![]() |
Перебробовал кучу контролов и классов, но не нашел ничего, что поддерживало бы русскую кодировку имен файлов: при (раз)архивации имя файла корежится.
Ежели кто-нибудь подскажет контролчик, буду благодарен несусветно. :) |
Ответы | Всего ответов: 9 |
Номер ответа: 1 Автор ответа: ![]() ![]() Вопросов: 9 Ответов: 115 |
Web-сайт: Профиль | Цитата | #1 | Добавлено: 21.11.06 09:36 |
Sharpziplib.dll |
Номер ответа: 2 Автор ответа: ![]() ![]() ![]() ICQ: 298826769 Вопросов: 53 Ответов: 1732 |
Профиль | Цитата | #2 | Добавлено: 21.11.06 13:02 |
Мне под VB6 треба... |
Номер ответа: 3 Автор ответа: ![]() ![]() Вопросов: 9 Ответов: 115 |
Web-сайт: Профиль | Цитата | #3 | Добавлено: 21.11.06 21:37 |
она под vb6 тож идёт |
Номер ответа: 4 Автор ответа: ![]() ![]() ![]() ICQ: 298826769 Вопросов: 53 Ответов: 1732 |
Профиль | Цитата | #4 | Добавлено: 21.11.06 23:24 |
А че-то по поиску примеры только под NET
Она не из FrameWork'а? |
Номер ответа: 5 Автор ответа: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Лидер форума ICQ: 216865379 Вопросов: 106 Ответов: 9979 |
Web-сайт: Профиль | Цитата | #5 | Добавлено: 22.11.06 17:06 |
Sharpziplib.dll
Не писал я такого... posts++ ![]() |
Номер ответа: 6 Автор ответа: ![]() ![]() Вопросов: 9 Ответов: 115 |
Web-сайт: Профиль | Цитата | #6 | Добавлено: 23.11.06 19:47 |
кароче сам разбирайся тока это под NET
Imports System.IO Imports System.IO.Compression Public Class ZipUtil Public Sub CompressFile(ByVal sourceFile As String, ByVal destinationFile As String) ' make sure the source file is there If File.Exists(sourceFile) = False Then Throw New FileNotFoundException End If ' Create the streams and byte arrays needed Dim buffer As Byte() = Nothing Dim sourceStream As FileStream = Nothing Dim destinationStream As FileStream = Nothing Dim compressedStream As GZipStream = Nothing Try ' Read the bytes from the source file into a byte array sourceStream = New FileStream(sourceFile, FileMode.Open, FileAccess.Read, FileShare.Read) ' Read the source stream values into the buffer buffer = New Byte(CInt(sourceStream.Length)) {} Dim checkCounter As Integer = sourceStream.Read(buffer, 0, buffer.Length) ' Open the FileStream to write to destinationStream = New FileStream(destinationFile, FileMode.OpenOrCreate, FileAccess.Write) ' Create a compression stream pointing to the destiantion stream compressedStream = New GZipStream(destinationStream, CompressionMode.Compress, True) 'Now write the compressed data to the destination file compressedStream.Write(buffer, 0, buffer.Length) Catch ex As ApplicationException MessageBox.Show(ex.Message, "An Error occured during compression", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally ' Make sure we allways close all streams If Not (sourceStream Is Nothing) Then sourceStream.Close() End If If Not (compressedStream Is Nothing) Then compressedStream.Close() End If If Not (destinationStream Is Nothing) Then destinationStream.Close() End If End Try End Sub Public Sub DecompressFile(ByVal sourceFile As String, ByVal destinationFile As String) ' make sure the source file is there If File.Exists(sourceFile) = False Then Throw New FileNotFoundException End If ' Create the streams and byte arrays needed Dim sourceStream As FileStream = Nothing Dim destinationStream As FileStream = Nothing Dim decompressedStream As GZipStream = Nothing Dim quartetBuffer As Byte() = Nothing Try ' Read in the compressed source stream sourceStream = New FileStream(sourceFile, FileMode.Open) ' Create a compression stream pointing to the destiantion stream decompressedStream = New GZipStream(sourceStream, CompressionMode.Decompress, True) ' Read the footer to determine the length of the destiantion file quartetBuffer = New Byte(4) {} Dim position As Integer = CType(sourceStream.Length, Integer) - 4 sourceStream.Position = position sourceStream.Read(quartetBuffer, 0, 4) sourceStream.Position = 0 Dim checkLength As Integer = BitConverter.ToInt32(quartetBuffer, 0) Dim buffer(checkLength + 100) As Byte Dim offset As Integer = 0 Dim total As Integer = 0 ' Read the compressed data into the buffer While True Dim bytesRead As Integer = decompressedStream.Read(buffer, offset, 100) If bytesRead = 0 Then Exit While End If offset += bytesRead total += bytesRead End While ' Now write everything to the destination file destinationStream = New FileStream(destinationFile, FileMode.Create) destinationStream.Write(buffer, 0, total) ' and flush everyhting to clean out the buffer destinationStream.Flush() Catch ex As ApplicationException MessageBox.Show(ex.Message, "An Error occured during compression", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally ' Make sure we allways close all streams If Not (sourceStream Is Nothing) Then sourceStream.Close() End If If Not (decompressedStream Is Nothing) Then decompressedStream.Close() End If If Not (destinationStream Is Nothing) Then destinationStream.Close() End If End Try End Sub End Class |
Номер ответа: 7 Автор ответа: ![]() ![]() ![]() ICQ: 298826769 Вопросов: 53 Ответов: 1732 |
Профиль | Цитата | #7 | Добавлено: 23.11.06 22:40 |
От и я говорю, что усе под нет... ![]() под выбы шесть надо! |
Номер ответа: 8 Автор ответа: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Разработчик Offline Client Вопросов: 236 Ответов: 8362 |
Профиль | Цитата | #8 | Добавлено: 26.11.06 20:22 |
VFunzip.ocx пробовал ? |
Номер ответа: 9 Автор ответа: ![]() ![]() ![]() ICQ: 298826769 Вопросов: 53 Ответов: 1732 |
Профиль | Цитата | #9 | Добавлено: 26.11.06 20:30 |
Найн! ![]() Если нет, ща поищу. ![]() |
Страница: 1 |
|