• 0

Open File for INPUT


Question

INPUT

when i open a file for input like a zip it doesn't show the whole file. why is this? what do i have to do to show the whole file?

<pre>



Private Sub Command3_Click()

Dim IntFile2 As Integer

Dim var As String, FTXT As String

IntFile2 = FreeFile

    On Error Resume Next

    CD2.ShowOpen

    Text1.Visible = True

    Open CD2.FileName For Input As IntFile2

        Do While Not EOF(IntFile2)

            DoEvents

            Input #IntFile2, var

            FTXT = FTXT + var

        Loop

        

        Text1.Text = FTXT

    

    Close IntFile2

    

End Sub





</pre>

THANKS

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

If you try to show it in a textbox then it will handle the data as a null-terminated string. When you read the file then you'll get all the data but when a function that handles strings reads it then it will stop when it detectes a zero. You understand?

I recommend you to use a byte array and not to handle it as a string.

Link to comment
Share on other sites

  • 0

i got it workin,

whats the best way to chopp up the binary? i downloaded this txt file shows the format of a zip, i wanna take out the filename + filesize + date modified + time modified. i wanna put em in different strings. should i read the whole file into a string and look for the info, cuse it takes a while if the file is big?

Link to comment
Share on other sites

  • 0

DAMN, this zip format is complicated, i wanted to know if there's a control or api i could download to get info on the files inside the zip ( FileName, FileSize, DateModified, Time Modified )

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.