Torna al Thread
GZipFile("C:\Documents and Settings\Administrator\Desktop\Produttività\DistintePSO\DistintePSO\bin\Debug\temp\prova.ttt", "C:\Documents and Settings\Administrator\Desktop\Produttività\DistintePSO\DistintePSO\bin\Debug\temp\prova.zip")
End Sub
Private Sub GZipFile(ByVal from_file As String, ByVal _
to_file As String)
Dim num_bytes As Long
Dim buf() As Byte
' Read the input file into a buffer.
Using from_stream As New FileStream(from_file, _
FileMode.Open, FileAccess.Read, FileShare.Read)
num_bytes = from_stream.Length
ReDim buf(num_bytes - 1)
from_stream.Read(buf, 0, num_bytes)
from_stream.Close()
End Using ' from_stream
' Write the buffer to the output file.
Using to_stream As New FileStream(to_file, _
FileMode.Create, FileAccess.Write, FileShare.Write)
Using zip_stream As New GZipStream(to_stream, _
CompressionMode.Compress)
zip_stream.Write(buf, 0, num_bytes)
zip_stream.Close()
End Using ' zip_stream
to_stream.Close()
End Using ' to_stream
End Sub
End Class