Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8235849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:57:18+00:00 2026-06-07T18:57:18+00:00

I am atempting to open a zip file and extract a password and 256

  • 0

I am atempting to open a zip file and extract a password and 256 AES encrypted text file into a stream which I can read WITHOUT puting a copy of the text onto the drive. If I understand what I want to do correctly, using a stream will acomplish that. Im not very experianced with code so Im using example that I found on the DontNetZip site which is bellow.
The problem is 2 fold, it throws 2 errors when processing, I was hoping that someone can help with these.

1 the first error occure on the 3rd line – “Using s As CrcCalculatorStream = e1.OpenReader” the error is ‘ Object reference not set to an instance of an object. ‘ I have tried declearing and new and still it crashes on that line.

2 the second error is on a line after the loop – “If (s.Crc32 <> e1.Crc32) Then” and the error is a squigly line under s.Crc32 and it sais that Crc32 is not a memeber of CrcCalculatorStream , a similar error under the e1.Crc32 which isnt a member of Ionic.zip.zipEntry

The code is as copied from this link http://cheeso.members.winisp.net/DotNetZipHelp/html/4ef6405c-33ff-a8aa-1731-def3ec5cac24.htm

Can someone help me get through the code to see if I can get the result that Im after , that is to have the content of the text file in a string so that I can read it

PS I have in my real program edited the references to a file and the correct zip name, the only addition is the password.

Thankyou

Using zip As New ZipFile(ZipFileToRead)
Dim e1 As ZipEntry = zip.Item("Elevation.mp3")
Using s As Ionic.Zlib.CrcCalculatorStream = e1.OpenReader(password)
    Dim n As Integer
    Dim buffer As Byte() = New Byte(4096) {}
    Dim totalBytesRead As Integer = 0
    Do
        n = s.Read(buffer, 0, buffer.Length)
        totalBytesRead = (totalBytesRead + n)
    Loop While (n > 0)
    If (s.Crc32 <> e1.Crc32) Then
        Throw New Exception(String.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32))
    End If
    If (totalBytesRead <> e1.UncompressedSize) Then
        Throw New Exception(String.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize))
    End If
End Using

End Using

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:57:20+00:00Added an answer on June 7, 2026 at 6:57 pm

    I managed to sort that out too , I just though that it might be usefull to somebody.

    Dim str as string

                        Using s As Ionic.Crc.CrcCalculatorStream = e.OpenReader(Password)
                            Dim sr As StreamReader = New StreamReader(s)
                            str = sr.ReadToEnd()
                        End Using
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to open the current process's executable file for read-write operations (I
I'm attempting to write a text editor. I'm unable to open a file. Why?
I currently have a url that looks like this: protocol://folder/file.js I can open this
Currently I am attempting to open a text file that was saved in Unicode
Attempting to set up an automated texting service for customers, where people can text
I was attempting to open a raw data file (.asc) format with Notepad and
I have a device driver module which does a register_chardev(). In the driver open()
I'm attempting to open a file in a C application. How do I check
(Using Delphi 5) I am attempting to open a log file using the following
In a C++ program, using std::ifstream, I'm attempting to open a user-specified file --

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.