hi there... homework????
anyway.. what are s1 and s2?? files??? opened like what???
you are writing one byte at a time, the same one you just readed ;)
look at this:
Code:
Dim index As Integer = 8
For i = 0 To s1.Length() - 1
'you read from somewhere a byte, and you store it inside a position of an array
bytes(i) = s1.ReadByte
If (i < index) Then
'you get the same byte you read before, and put in into another file
s2.WriteByte(bytes(i))
End If
index = index + 8
Next
I think your logic is somehow wrong.. you have to read 8 bytes from the source, combine them (what's the diference between file 1 and 2??) and then you have to save it to destination...
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========