![]() |
Click here to advertise with us
|
|
|||||||
| VB.NET General Discussion VB.NET general discussion area |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all, I'm sdudying for the Microsoft Exam 70-536 and I'm working through some examples in the self paced book.
In looking at the following code example and trying to figure out the GZipStream class I do not see where the data.zip file is being saved. Is there some default path this goes? Code:
Dim gzOut As GZipStream = New GZipStream(File.Create("data.zip"), CompressionMode.Compress)
Dim sw As StreamWriter = New StreamWriter(gzOut)
For i As Integer = 1 To 999
sw.Write("Hello World!")
Next
sw.Close()
gzOut.Close()
Strick |
|
|||
|
File.Create Method (String) (System.IO)
Quote:
|
|
||||
|
You should be aware that the GZipStream class does NOT create a ZIP file. It's inappropriate for you to give it a ".zip" extension because it does not have the ZIP format. The GzipStream class creates a GZIP file, which is a different format. You should give the file the standard ".gz" or, if you prefer, ".gzip" extension.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms MSDN: Data Walkthroughs | "How Do I?" Videos My Blog: Custom Events | Dynamic GDI+ Drawing |
|
|||
|
Thanks guys,
Also in response to your post jmcilhinney; thank you because that really clarifies some things. In the book this is the exact code sample they used so I was a little confused as to if this compression class was meant to create and read .zip files or really just to compress/decompress text files for transfer. Strick |
|
||||
|
Quote:
To get around this limitation, most people use the TAR format to combine multiple files into one in an uncompressed format, then compress the TAR file into a GZIP file. Such files normally have a ".tar.gz" or ".tgz" extension and are affectionately known as "tar balls". The adavantage is that the compression is generally more efficient than the ZIP format. The disadvantage is that you must decompress the entire GZIP file to be able to get one of the source files out of the TAR file, where ZIP files allow you to decompress a single source file.
__________________
![]() 2007, 2008, 2009, 2010 Why is my data not saved to my database? | Communicating between multiple forms MSDN: Data Walkthroughs | "How Do I?" Videos My Blog: Custom Events | Dynamic GDI+ Drawing |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|