HI, I am using CGZipLibrary.dll in my code for zipping the files. A .zip file is being created but the file is not getting compressed. The original file and the .zip file are of same size.
Please provide some suggestions. Thanks in advance.
CGZipLibrary.dll... that's a rather old library if my memory is serving me right, I remember using it (or some other library with a similary name) in some old VB6 projects, and I had to update it because it had some problems when compressing folder structures. I may have the updated library lying somewhere around.
For .Net there are better alternatives like SharpZipLib and DotNetZip. I see the question is tagged with VB6 as well... if you need to use the library from VB6, from what I know, DotNetZip is marked as visible for COM, so you should be able to use it as well, although haven't tried it myself.
Related
I made a small program (App.exe) by (Visual Basic Language) that replaces some files, and a place those files in my preject recoures
the problem is when i build the program i can decompressing the App.exe and see those files like a archive with any decompressing software like a WinRAR or 7-zip, and me i don't want that, this is a image from my computer, someone can help me, thanks in advance
You may use ConfuserEx obfuscator (Google it to get that). After encrypting the app with it, it'll be almost impossible to decompile it or get its raw files (resources) even after extraction.
Simply drag and drop your application into it:
Use Compressing packer:
And finally protect it:
And you're good to go.
I have some files which need reading using Access / VBA. They are compressed using ".gz" compression. How can I read those files in?
I figure this must be a solved problem but alas can't find anything. Command-line would be one option but it would involve the users of the VBA application having to have particular tools installed. Perhaps there is a library I can just include, which I can then ship with my VBA application (.accdr)?
There are quite a few libraries around, however, probably the most popular is zlib. A nice example using zlib, albeit written in VB6 (which shouldn't be too difficult to convert to VBA) is located here. One nice point about zlib is that it doesn't need registering (i.e. REGSVR*), so you should be able to drop it into the same folder as your DB (or even embed it into the DB then extract it automatically).
I have a need to handle various rar/zip files, in Objective-C. Ideally I'd like to be as flexible as possible in terms of rar/zip versions. I'd also like to be able to only extract certain files from the rar/zip files, after pulling out a list of the file contents.
If that wasn't enough, I'd like to be able to access and modify the zip comment.
Is this easily possible in objective-c? I've searched around a lot and found a lot of half-finished libraries that don't do everything I want, or only support rar up to version 2, or don't support extracting single files.
I know I could just use the command line unzip tool that ships with MacOS Panther and up, but this seems inelegant and doesn't help me with rar files, as no unrar application ships with MacOS by default.
Can anyone point me at a decent library that does one or the other of these two types of files, or a recommended best approach for dealing with this problem? I know that one option is to wrap the unrar source, and also wrap the zlib source, but this to me is a daunting task. If there's no other option I'll do it - any advice or guidance on this would be gratefully received.
Thanks!
Yes, doing that it's easy in objective C. For zip files just use ZLIB (it's already included in Mac OS X.
RAR is not that simple though. Look for a C library (not an Objective-C library). There will be way more C libraries for RAR handling than Objective-C ones. And you can use all C libraries you want within an Objective-C program.
Is it possible to programmatically zip/unzip files in vb.net? Meaning, not that it will extract the files for the user, but take the files inside the zip and be able to use them in the application? Then, is it possible for this to create a zip?
I couldn't seem to find a compression namespace anywhere.
Thanks for the help!
We used SharpZibLib in the past with great success.
You can also have look at the System.IO.Compression namespace, it provides the functionality compress and decompress streams but unfortunately not the functionality to extract files from a Zip file :(
Update:
I wasn't aware of this namespace System.IO.Packaging, seems it can indeed deal with files 'packed' into a zip file.
For an excellent commercial solution try http://xceed.com/
We have used this and it's great for working with zip file (and for merging and creating self-extracting zips if this is required)
note: Not affiliated with Xceed in any way.
There are many programs out there that will allow you to pack a few files together and generate an executable that has the necessary code to extract them. Somehow, those files are residing inside the executable. I am interested in doing the same thing; how is this done?
FYI, I'm interested primarily in Windows .exe files, if it makes a difference.
Look at this: Article
You could probably save a file/files in a resource, compile it into the exe then use some code in the exe to extract it out to a file.
ie:
http://www.codeproject.com/KB/winsdk/binaryresources.aspx
Self extracting .exe files are usually archive files (zip, rar, tar, etc) concatenated together with a small program that does the extraction then executes the program that was extracted from the archive.
A really sophisticated one could extract the archive into memory and then jump to the extracted code and run it, but back in the old days, that sort of thing was easier to do.
If you wanted to write your own in Windows, you would create a small console application that did the extraction, and you would include the 'real' program in the console programs' resources.
There are also products like pkzip and winzip which do it for you. If your time is worth anything, those would be more efficient.
UPX is a well known packer for Windows .EXE which can be found here on WikiPedia. And here is the main site on sourceforge for UPX.
Hope this helps,
Best regards,
Tom.