মিনি নোট বুক প্রোজেক্ট ...
ফিচার সমুহঃ
১। নতুন টেক্সট ফাইল তৈরি করতে পারবেন , আপনার ফাইল টা your file name.c এভাবে সেভ করলে কোডিং ও করতে পারবেন ।
২। আপনার তৈরি করা ফাইল ভিউ করতে পারবেন
৩। পাসওয়ার্ড দিয়ে ফাইল প্রোটেক্ট করতে পারবেন
সোর্স কোডঃ
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
int select,load,load2;
char fn[20],word[20],text;
FILE *file1;
int menu();
void create();
void pass();
void view();
void delete();
void main()
{
system("cls");
system("COLOR 4f");
printf("\n\n\t\t\tNote Book By SHOAEB\n\t\t\tPress Any Key To Run..\n\n\n\n");
getch();
printf("\tPlease wait.");
for(load=1;load<=38;load++){
for(load2=0;load2<=10000000;load2++);
printf("%c",177);
}
system("cls");
system("COLOR 4f");
pass();
system("cls");
system("COLOR 4f");
menu();
}
int menu()
{
do {
system("cls");
system("COLOR 4f");
printf("\n\n\n\t**NOTE BOOK**\n\t______________________\n");
printf("\n\t1.CREATE A NOTE\n\t2.VIEW NOTE\n\t3.DELETE NOTE\n\t4.LOG ME OUT(any key)\n");
printf("\n\tEnter your choice: ");
scanf("%d",&select);
switch(select)
{
case 1:
create();
break;
case 2:
view();
break;
case 3:
delete();
break;
default:
printf("\n\n\t\tPlease wait while Logging out");
for(load=1;load<=60;load++){
for(load2=0;load2<=10000000;load2++);}
pass();
}
}while(1);
}
void create()
{ system("cls");
system("COLOR 4f");
printf("\n\n\n\t\t***CREATE A NOTE***\n\n\n");
printf("\tEnter the note name: ");
gets(fn);
gets(fn);
file1=fopen(fn,"w");
printf("\n\tPLEASE ENTER THE TEXT PRESS '~ ' TO SAVE\n");
while(1)
{
text=getchar();
if(text!='~')
fputc(text,file1);
else
{
fclose(file1);
printf("\n\tSuccessfully saved\n\tpress any key.");
getch();
system("cls");
system("COLOR 4f");
break;
}}
}
void view(){
system("cls");
system("COLOR 4f");
printf("\n\n\n\tEnter note name: ");
gets(fn);
gets(fn);
file1= fopen(fn,"r");
if(file1 == NULL)
{
printf("\n\n\tNote not found");
goto loop1;
}
while(!feof(file1))
{
text = fgetc(file1);
printf("%c",text);
}
loop1:
fclose(file1);
printf("\n\tPress any key to return Main Menu..");
getch();
system("cls");
system("COLOR 4f");
}
void delete()
{
system("cls");
system("COLOR 4f");
printf("\n\tEnter the Note name: ");
gets(fn);
gets(fn);
file1=fopen(fn,"r");
if(file1==NULL)
{
printf("\n\tNote not found!");
goto loop2;
}
fclose(file1);
if(strcmp(fn,fn)==0)
{
remove(fn);
printf("\n\n\tNote has been deleted successfully!\n");
goto loop2;
}
else
printf("\n\tError!\n");
loop2: printf("\n\n\tPress any key to continue...");
getch();
system("cls");
system("COLOR 4f");
}
void pass (){
FILE *fp;
char c[100],s[100];
int i;
cr:
system("cls");
system("COLOR 4f");
printf("\n\n\n\t\t***SECURITY CHECK***\n");
printf("\n\t\t1.CREATE A NEW PASSWORD\n\n\t\t2.LOGIN TO NOTE BOOK\n\n\t\t3.EXIT\n");
scanf("%d",&i);
if(i==1){
system("cls");
system("COLOR 4f");
printf("\n\n\t\tCreate Password: ");
gets(c);
gets(c);
fp=fopen("C:/#","w");
fputs(c,fp);
fclose(fp);
printf("\n\t\tSuccesfully Created..Now login\n\n\a");
getch();
goto cr;
}
else if (i==2){
fp=fopen("C:/#","r");
if(fp==NULL){
printf("\n\n\t\tErorr..Create A password 1st\a");
fclose(fp);
getch();
goto cr;
}
else{
system("cls");
system("COLOR 4f");
printf("\n\n\t\tEnter Password to login to Notebook: ");
gets(s);
gets(s);
fgets(c,100,fp);
if(strcmp(s,c)==0){
printf("\n\n\t\tMatched...press any key\n\n\n");
getch();
system("cls");
}
else{
printf("\n\n\t\tWrong password..press any key to try again\a\n\n\n ");
getch();
system("cls");
system("COLOR 4f");
goto cr;
}
fclose(fp);
}
}
else{
exit(0);
}
}