For just some fun i am trying to use Flat File databases to read some data.The file used is text file and plain text format. I did design it such that there is format of storing the data for example a user record like below.
stackoverflow | 12345 | 12/12/2012 12:12:12 AM
where the above data if of format username | password | lastlogin
. I am thinking of what are the ways i can validate a user using username, password and if found update the last login date and save the file without a exception(other users will also be using same file)
Could you explain with a code how to update last logindate when login successfull & how to validate username password.
I am using C#, .NET 2.0..
Right now psedocode is like below;
File read DB.txt
When text not empty
split text in file with \n as separator character
For each item in the output array split using pipe symbol
check if [0] and [1] index match with username & password supplied
if matched
How to update and save