Click here to Skip to main content
15,921,959 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionfiles creating Pin
Celldet18-Nov-08 3:34
Celldet18-Nov-08 3:34 
AnswerRe: files creating Pin
Gideon Engelberth18-Nov-08 3:47
Gideon Engelberth18-Nov-08 3:47 
GeneralRe: files creating Pin
Celldet21-Nov-08 4:48
Celldet21-Nov-08 4:48 
QuestionDecompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 0:15
thiru_586218-Nov-08 0:15 
AnswerRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Dave Kreskowiak18-Nov-08 1:58
mveDave Kreskowiak18-Nov-08 1:58 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 19:05
thiru_586218-Nov-08 19:05 
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 
Sorry Dave.. I gave the old code .. Below u can find the latest code i use. In the below code.. am getting the exception(Magic number in GZip header is INCORRECT) in line
n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)

'Compressed File path
dim comp_file as string = "c:/compressed.txt"
'File to which decompressed contents has to be written
dim dest_file as string ="c:/decompressed.txt"

Dim sourceFile As FileStream = File.OpenRead(comp_file)
Dim destinationFile As FileStream = File.Create(dest_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(dest_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(sourceFile, _
CompressionMode.Decompress, False)

Console.WriteLine("Decompressing {0} to {1}.", sourceFile.Name,_
destinationFile.Name)

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

'Close the files.

sourceFile.Close()
destinationFile.Close()
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 
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 

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.