Results 1 to 7 of 7

Thread: Open a file from zip archive

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Question Open a file from zip archive

    ok if there is any way to open a file from zip archive without extracting it ?

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Open a file from zip archive

    Hm... I don't think so.

    Why wouldn't you want to extract it?
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: Open a file from zip archive

    Quote Originally Posted by weirddemon View Post
    Hm... I don't think so.

    Why wouldn't you want to extract it?
    if you see KMP ? it run video from a zip archive i want to do this with images exactly like window$

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Open a file from zip archive

    That depends on exactly what you mean. You obviously have to extract the data from the archive to use it, but you don't necessarily have to save the extracted data as a file. That depends on how you want to use it. If you want to open it in an external application then you most likely will have to save it, because that application will need to read the data itself. If you want to, for instance, show the contents of an extracted text file in a TextBox in your own app then you won't need to save, because you've already got the file contents.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: Open a file from zip archive

    ok just tell me how windows read it without extracting any file

  6. #6
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Open a file from zip archive

    Windows does extract it, you just don't see it.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Open a file from zip archive

    Windows itself and lots of other applications will create files in your Temp directory in situations like this. You can do the same. Extract the data from the archive and then just use it as is if you don't need a file but, if you do need a file create one in the Temp directory and then delete it again afterwards. The .NET Framework even provides a specific mechanism for doing so. The IO.Path.GetTempFileName method will create an empty file in the Temp folder with a random name and return that name to you. You can then save your data to that file and then delete it again afterwards. There's no indication in the file name or location of what the file contains, so it's relatively anonymous. THAT is how Windows does it, that's how lots of applications do it and that's how you should do it too.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | 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