Today We Discuss About How To Create Password With Protected Mode
This is very easy to learn from making a file which open with a protected password. That
is why I made a program both in Turbo C compiler as well as Dev C++ that enables a user to understand it and input his desired string
length password and string name then activates the program to count how many
characters are there in the input.
I am making this program with very interesting manner to add sum color like Red,Yellow and many more which look like very good design and layout . I am some more feature to make better the use the time for manage the loading time.
We all know that a string is a random inputs of different characters.
Today, I'm about to show you how to count characters in a srtring input.
This program is used with the
string length statement which enables the program to count how many characters are there in a string. Check out the sample code below .
ाू
This is the Program of Turbo C Compiler
#include<fstream.h>
#include<iostream.h>
#include<string.h
#include<conio.h>
#include<stdio.h>
#include<time.h>
#include<dos.h>
void display();
void main()
{
char str[25],cstr[25],inform[1000];
clrscr();
textcolor(RED);
textbackground(WHITE);
cout<<"\n\n\t\t This is the system of the Important File sysytem\n";
cout<<"\n\n\t In This Project we open the file using the high security Password";
clrscr();
cout<<"\n\n\n\n\t\tEnter the password for open the file sysytem\n";
gotoxy(60,40);
cout<<"\n\n\n\n Password->";
textcolor(BLUE);
str[0]=getch();
cout<<"*";
str[1]=getch();
cout<<"*";
str[2]=getch();
cout<<"*";
str[3]=getch();
cout<<"*";
str[4]=getch();
cout<<"*";
str[5]=getch();
cout<<"*";
str[6]=getch();
cout<<"*";
str[7]=getch();
cout<<"*";
str[8]=getch();
cout<<"*";
str[9]=getch();
cout<<"*";
str[10]=getch();
cout<<"*";
str[11]=getch();
cout<<"*";
str[12]=getch();
cout<<"*";
str[13]=getch();
cout<<"*";
str[14]=getch();
cout<<"*";
str[15]='\0';
cout<<"*";
if(strcmp(str,"RISHABHSHIVHARE")==0)
{ cout<<"\n\n\n\n\n\tPLEASE WAIT WHILE LOADIND THE PROJECT";
delay(150);
cout<<"<";
delay(150);
cout<<">";
delay(150);
cout<<"<";
delay(150);
cout<<">";
delay(150);
cout<<"<";
delay(150);
cout<<">";
delay(150);
cout<<"<";
delay(150);
cout<<">";
delay(150);
cout<<"<";
delay(150);
cout<<">";
getch();
clrscr();
cout<<"\n\n\n\n Welcome To The System Of File Operating";
cout<<"\n\n\n\n ";
gotoxy(85,74);
delay(180);
cout<<"R";
delay(180);
cout<<"i";
delay(180);
cout<<"s";
delay(180);
cout<<"h";
delay(180);
cout<<"a";
delay(180);
cout<<"b";
delay(180);
cout<<"h";
delay(180);
cout<<" ";
delay(180);
cout<<"S";
delay(180);
cout<<"h";
delay(180);
cout<<"i";
delay(180);
cout<<"v";
delay(180);
cout<<"h";
delay(180);
cout<<"a";
delay(180);
cout<<"r";
delay(180);
cout<<"e";
getch();
clrscr();
int choice;
cout<<"\n\n File Oerating System\n";
cout<<"\n\n [1] WRITING MODE -";
cout<<"\n\n [2] READING MODE -";
cout<<"\n\n [3] EXIT MODE -";
cout<<"\n\n Enter the Choice -";
cin>>choice;
switch(choice)
{ case 1:
int c,choice; clrscr();
cout<<"\n\n Do you want to write->";
char ch;
fstream f1;
f1.open("password.dat",ios::app|ios::binary);
cout<<"\n\n\t DO you want to save the record(y/n)\t";
cin>>ch;
if(ch=='y')
{
f1.write((char*)&c,sizeof(c));
}
f1.close();
break;
case 2: cout<<"Enter the password For open this-";
cout<<"\n\n";
cstr[0]=getch();
cout<<"*";
cstr[1]=getch();
cout<<"*";
cstr[2]=getch();
cout<<"*";
cstr[3]=getch();
cout<<"*";
cstr[4]=getch();
cout<<"*";
cstr[5]=getch();
cout<<"*";
cstr[6]=getch();
cout<<"*";
cstr[7]=getch();
cout<<"*";
cstr[8]=getch();
cout<<"*";
cstr[9]=getch();
cout<<"*";
cstr[10]=getch();
cout<<"*";
cstr[11]=getch();
cout<<"*";
cstr[12]=getch();
cout<<"*";
cstr[13]=getch();
cout<<"*";
cstr[14]=getch();
cout<<"*";
cstr[15]='\0';
cout<<"*";
if(strcmp(cstr,"RISHABHSHIVHARE")==0)
{ cout<<"\n\n\n\n\n\tPLEASE WAIT WHILE LOADIND THE PROJECT";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
delay(200);
cout<<"|";
getch();
clrscr();
//consumer c;
fstream f1;
f1.open("password.dat",ios::in|ios::binary);
while(!f1.eof())
{
f1.read((char*)&c,sizeof(c));
display();
if(f1.eof())
{cout<<"\n\n End of the reached\n\n";
}}
f1.close();
}getch();
break;
default: cout<<"Error | | | |";
break;
}}
else
{ cout<<"\n\n\n\t\t You are the failure";
} getch();
}
void display()
{ char inform[1000];
cout<<"Enter the information-";
gets(inform);
}
tt