Click here to Skip to main content
16,005,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 19:19
thiru_586218-Nov-08 19:19 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 20:50
thiru_586218-Nov-08 20:50 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Dave Kreskowiak19-Nov-08 2:01
mveDave Kreskowiak19-Nov-08 2:01 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586219-Nov-08 2:13
thiru_586219-Nov-08 2:13 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Dave Kreskowiak19-Nov-08 4:44
mveDave Kreskowiak19-Nov-08 4:44 
JokeRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Paul Conrad19-Nov-08 4:54
professionalPaul Conrad19-Nov-08 4:54 
AnswerRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Paul Conrad18-Nov-08 4:55
professionalPaul Conrad18-Nov-08 4:55 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 19:05
thiru_586218-Nov-08 19:05 
Hi Paul.. The code which i use to decompress the file is given below..


dim source_file as string = "c:/Compressed.txt"
dim destination_file as string = "c:/Decompressed.txt"

Dim sourceFile As FileStream = File.OpenRead(source_file)
Dim destinationFile As FileStream = File.Create(destination_file)
destinationFile.Close()
Dim ms As New MemoryStream()
Dim zipStream As New DeflateStream(ms, CompressionMode.Decompress)
Dim decompressedBuffer(3500) As Byte

System.IO.File.WriteAllBytes(destination_file, decompressedBuffer)
'end writing

'Because the uncompressed size of the file is unknown,
'we are imports an arbitrary buffer size.
Dim buffer(4096) As Byte
Dim n As Integer

Using input As New GZipStream(source_file, _
CompressionMode.Decompress, False)

Console.WriteLine("Decompressing {0} to {1}.", source_file.Name, _
destination_file.Name)

n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)
destination_file.Write(decompressedBuffer, 0, n)
End Using

'Close the files.

source_file.Close()
destination_file.Close()
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Paul Conrad18-Nov-08 19:25
professionalPaul Conrad18-Nov-08 19:25 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 20:45
thiru_586218-Nov-08 20:45 
QuestionHow to register COM component into c# .net window application Pin
veereshIndia17-Nov-08 22:33
veereshIndia17-Nov-08 22:33 
AnswerRe: How to register COM component into c# .net window application Pin
indian14318-Nov-08 0:45
indian14318-Nov-08 0:45 
AnswerRe: How to register COM component into c# .net window application Pin
Dave Kreskowiak18-Nov-08 1:57
mveDave Kreskowiak18-Nov-08 1:57 
AnswerRe: How to register COM component into c# .net window application Pin
Paul Conrad18-Nov-08 4:57
professionalPaul Conrad18-Nov-08 4:57 
GeneralRe: How to register COM component into c# .net window application Pin
leckey18-Nov-08 6:19
leckey18-Nov-08 6:19 
GeneralRe: How to register COM component into c# .net window application Pin
Jon_Boy18-Nov-08 6:44
Jon_Boy18-Nov-08 6:44 
GeneralRe: How to register COM component into c# .net window application Pin
Paul Conrad18-Nov-08 6:45
professionalPaul Conrad18-Nov-08 6:45 
GeneralRe: How to register COM component into c# .net window application Pin
indian14318-Nov-08 18:16
indian14318-Nov-08 18:16 
RantRe: How to register COM component into c# .net window application Pin
Smithers-Jones19-Nov-08 1:01
Smithers-Jones19-Nov-08 1:01 
GeneralRe: How to register COM component into c# .net window application Pin
indian14319-Nov-08 1:09
indian14319-Nov-08 1:09 
GeneralRe: How to register COM component into c# .net window application Pin
Dave Kreskowiak19-Nov-08 2:04
mveDave Kreskowiak19-Nov-08 2:04 
QuestionGridView Problem Pin
soniasan17-Nov-08 20:27
soniasan17-Nov-08 20:27 
AnswerRe: GridView Problem Pin
Mycroft Holmes17-Nov-08 20:59
professionalMycroft Holmes17-Nov-08 20:59 
AnswerRe: GridView Problem Pin
Dave Kreskowiak18-Nov-08 1:54
mveDave Kreskowiak18-Nov-08 1:54 
Questionmoving folders and files across network [modified] Pin
jishbalan17-Nov-08 19:01
jishbalan17-Nov-08 19:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.