Results 1 to 40 of 82

Thread: ZIP Compression Using Pure Visual Basic

Hybrid View

  1. #1
    Lively Member rm_03's Avatar
    Join Date
    Aug 2004
    Posts
    92

    Re: ZIP Compression Using Pure Visual Basic

    there also some other good compression stuff on the site as well.
    Yes, like:
    http://www.pscode.com/vb/scripts/Sho...53174&lngWId=1

    /edit:
    BTW, where does all this "VB can't do this, use C!!" stuff come from?
    The only things VB can't do is drivers, safe multi threading (at least as standard EXE) and direct low level IO.
    And creating ZIP files is far away from being low level ;-)
    Last edited by rm_03; Aug 21st, 2005 at 11:06 AM.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: ZIP Compression Using Pure Visual Basic

    I understand I flamed this thread abit, HOWEVER I will be proven wrong ONLY if someone shows me a really working example of "creating zip file using pure any pre dot net vb" and it has to perform just like Winzip, RAR, PKZip and/or some others do - it could better but not lousy. Until then it's all going to be speculations. Sorry.

  3. #3
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: ZIP Compression Using Pure Visual Basic

    Quote Originally Posted by rm_03
    BTW, where does all this "VB can't do this, use C!!" stuff come from?
    It comes from the 90's when C++ got a lot of fanboys and they bashed VB all they could. Atleast, that is one of the main reasons.

    Rhino: what you're trying to say is that VB couldn't handle reading and writing a file. A ZIP is a file, thus is made of bits. You can handle bits with VB (And, Or, Xor, bitshifting with some trick code). Reading and writing a ZIP file is just converting data from a format to another.

    You can find a JPEG compressor over at PSC, which saves JPG files. Also, I've made a MIX file reader and writer using VB: MIX files are from Command & Conquer, which is a archive format without actual compression by the file format itself as the contents that were stored were already compressed; which is very much like ZIP. ZIP compresses individual files and acts otherwise as an archive. Too bad I lost the source for that when my harddisk failed a few years ago... not that C&C or Red Alert would be interesting these days.

    I have also made a Settlers II map reader and writer which contains multiple map data for a single map... quite similar to archive file, though lacks details for filenames. For Transport Tycoon I have a reader for GFX files (contains multiple compressed graphics files), though I never got as far as writing the code for saving a file. I could have.

    These should be enough to proof ZIP file reading and saving can be done with VB. WinZip, PKzip and the like use ASM optimized code, so you just can't beat them with higher level languages no matter what you do. You could make the speed quite good though.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: ZIP Compression Using Pure Visual Basic

    Quote Originally Posted by Merri
    ... A ZIP is a file, thus is made of bits. You can handle bits with VB (And, Or, Xor, bitshifting with some trick code). ...
    That's correct.

    Quote Originally Posted by Merri
    ... Reading and writing a ZIP file is just converting data from a format to another. ...
    That's where the problem resides.

  5. #5
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: ZIP Compression Using Pure Visual Basic

    Reply to abazabam,
    Hello abazabam,
    You can try winzip Comand line

    download this 2 files from http://www.winzip.com/downcl.htm

    1)WinZip 9.0
    2)Command Line Support Add-On 1.1 SR-1

    than read the documentation about Command Line Support Add-On 1.1 SR-1

    i wrote a VB code using a batch file:

    VB Code:
    1. Call Shell("C:\myBatch.bat", vbMaximizedFocus)

    inside myBatch i used the wwzip command:
    Code:
    C:\wzzip C:\myZip.zip C:\*.pdf
    All the pdf file will be zip to one zip file called myZip.zip

    Best Regards,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width