Login and register from txt file using java | fun with java #1

Publié le: 13 juin 2019
sur la chaîne: RAPIDCLICKS
58,953
737

This video basically an implementation to write in txt (text) file and retrieve its data in a formal way. Enjoy :)

Got stuck somewhere?
Download the source code: https://github.com/Nilesh-d/TextLogin


Explanation
8:13
addData :
1) Fetch file
2) skip no. of lines already exists
3) write batch files

(you should skip checkData, it only work for single batch of data)

22:27
logic:

working:
1)loop through each data batch
2)check user and password if match, then print found and exit
3)if last data batch then print not found and exit
4)skip lines that are not username and password i.e email, blank line,etc.

1) increments = number of data in single batch
exp: loop through no. of data batches

2) check for incorrect user = increments - 1
exp: check if current batch is the last batch of entire document and no user and password matched.

3) lines to skip = k = increments - data lines other than user and password
exp: we need only user and password to check and skip other lines of single batch

variables values need to be adjusted:
i+= [increments] (no. of data batch)
ln-[increments - 1] (no. of lines inside each batch - 1)
k till= [k] (no. of lines to skip)

batch example:(no. of lines inside each batch should be equal)
---------------------
Username:youtube
password:pass
email:mail@mail.com

Username:stack
password:overflow
email:stack@mail.com
----------------------

no. of data batches = 2
no. of lines inside each batch (4) - 1 = 3 (except last batch,including blank line)
no. of lines to skip = 2 (except last batch, including blank line)



audio credit: www.bensound.com


Sur cette page du site, vous pouvez voir la vidéo en ligne Login and register from txt file using java | fun with java #1 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur RAPIDCLICKS 13 juin 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 58,953 fois et il a aimé 737 téléspectateurs. Bon visionnage!