Archived

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

ErayMan

Access to file in VB6

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 this post


Link to post
Share on other sites