#### Archived

This topic is now archived and is closed to further replies.

This topic is 5577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi there I made a little program to test an encryption app that i made with VB6 I encrypted all 256 ascii caracters using a key, then write the result in a file. I checked the lenght of the string that i write in the files, and it is indeed 256, so it''s allright. Then i immediatly read from the same file, but i only read 218 caracters! So, i write 256 car, but read 218 car, how come? here is a sample of my program:

Dim i As Integer
For i = 1 To 255
ChaineAEncrypter = ChaineAEncrypter + Chr(i)
Next
MsgBox Len(ChaineAEncrypter) ''Results: 255
ChaineEncryptee = Encrypter(ChaineAEncrypter)

Open App.Path & "\TextFile.txt" For Output As #1
Print #1, ChaineEncryptee & Chr(13)
Close #1

MsgBox Len(ChaineEncryptee) ''Results: 255

Open App.Path & "\TextFile.txt" For Input As #1
Input #1, ChaineDecryptee
Close #1

MsgBox Len(ChaineDecryptee) ''Results: 218
ChaineDecryptee = Decrypter(ChaineDecryptee)

It seems it has problem with some of the ascii caracters, as from 1 to 128, there''s no problem but after that, it gets weirder I tried using binary file access, but, to tell the truth, i coucn''t find any info on how it works, so i couldn''t make it well any help is wellcome -ErayMan

##### Share on other sites
I suspect you''re writing a EOF (0) somewhere in the file. Well, about the 219th character to be percise.

##### Share on other sites
Oh... I see, well that seems very logical hehe
Thanks a lot shag
-ErayMan

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631428
• Total Posts
3000027
×