// Name: Login Using a Text File in C
// Description:While I'm writing my book on C programming I came across with the idea to include in my book topic on File Handling in C. The idea is to write a program using C as my programming language to store a username and password in a text file and create a login program that will ask the user to give the username and password. The program will search for the username and password that is already stored in our text file. In this example the name of the text file is users.txt. I
If the username and password are correct and can be located in the text file the program will allow the user to access the system. But if username or password is incorrect the program will not allow the user to access the system. I hope you will find my work useful. Thank you.
I am currently accepting programming work, it projects, school and application development.
programming projects, thesis and capstone projects, IT consulting.
work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following email@example.com, firstname.lastname@example.org, and email@example.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.
My personal website is http://www.jakerpomperada.com
// By: Jake R. Pomperada
Author: Jake Rodriguez Pomperada,MAED-IT
Emails: firstname.lastname@example.org and email@example.com
Location : Bacolod City, Negros Occidental
Tool : Dev C++ Version 5.11
Date : January 7, 20193:46 PM Monday
void get_ID_and_PASS(char fileName,char *id,char *pass)
FILE *F = fopen(fileName,"r");
int count = 0;
}else printf("Cannot open this file");
char fileName = "users.txt";
char IDpref = "user_id:\0",PASSWpref = "password:\0";
int pos = 0;
printf("\tLOGIN SECURITY SYSTEM IN C USING TEXT FILES");
printf("\tEnter User Name : ");
printf("\tEnter Your Password : ");
c = getch();
if( isprint(c) )
strPASSW[ pos++ ] = c;
else if( c == 9 && pos )
strPASSW[pos--] = '\0';
printf("%s", "\b \b");
} while( c != 13 );
printf("\tCorrect Username And Password\n");
printf("\n\n\tWelcome to the System\n\n");
printf("\tInvalid Username And Password. Try Again\n\n");
printf("\tEND OF PROGRAM");