Hi,
i've written a code for writing data on binary file:
QByteArray ar
=ui
->User_signUp
->text
().
toUtf8()+"%"+ ui
->Pass_singUp
->text
().
toUtf8()+"$";
file.write(ar);
QByteArray ar=ui->User_signUp->text().toUtf8()+"%"+ ui->Pass_singUp->text().toUtf8()+"$";
QFile file("users.dat");
file.open(QIODevice::WriteOnly | QIODevice::Append );
file.write(ar);
To copy to clipboard, switch view to plain text mode
pattern in binary file:
username0%password0&username1%password1& ...
username0%password0&username1%password1& ...
To copy to clipboard, switch view to plain text mode
Now assume that i want to read a specific Stirng (Like username1 - i mean search a string) from file, i don't want to read whole file,because file may have huge data, for this i'm using "%" and "&" to know where an username or a password ends.
do we have a solution for this?!
BR
Bookmarks