Cyber Management System Project Using C Language
Introduction
This C Cyber Management System small project makes use of a variety of C technologies such as sockets, multithreading, and more. It might be quite beneficial for novices in the programming sector who are learning C languages. To store records, file management has been employed as a database.
Understanding this project can aid you in developing management software or micro-projects such as personnel records, bank management, library management, and so on. The project is split into two parts: one for the client and another for the server.
This little project on Cyber Management System in C has two separate source codes: one for client routines and the other for server operations. For socket programming in C, see a client-server example.
The server application is used to manage client requests and settings. Clients may use the cyber services thanks to the client program.
Source Code for Cricket Score Display Project Using C Language
Client Code
#include "function.h"
int main(){
console_settings();
ip=fopen("ip_add.dat","rb");
if(ip==NULL){
ip=fopen("ip_add.dat","wb");
gotoxy(10,5);printf("Enter IP address : ");
gotoxy(10,7);printf("Enter port number: ");
gotoxy(10,9);printf("Enter client number: ");
gotoxy(29,5);fflush(stdin);gets(ip1.ip_address);
gotoxy(30,7);scanf("%d",&ip1.port_no);
gotoxy(32,9);scanf("%d",&ip1.client_no);
fseek(ip,0,SEEK_END);
fwrite(&ip1,sizeof(ip1),1,ip);
}
fclose(ip);
assign_ip_address();
HWND hwnd = GetConsoleWindow();
ShowWindow(hwnd,SW_MAXIMIZE);
if(!SOCKET_START){
start_socket();
connect_server();
SOCKET_START=true;
}
start_log:
log_stat = 0;
login_screen(); //displays log_in screen, checks
time_thread = (HANDLE) _beginthread( show_time,0,0);
start_menu:
main_menu();
while(1){
if(get_code()==60) {
show_menu();
break;
}
}
char sel;
while(1){ //send data until the clients shuts down or disconnects(end)
// selected=get_code();
// printf("pressed");
switch (sel = tolower(getch())) {
case '1':
if(flag_menu==0) {
service_menu();
}
break;
case '2':
if(flag_menu==0) {
credits();
}
break;
case '3':
if(flag_menu==0) {
log_stat = 2;
log_out();
}
break;
case 27:
if(flag_menu==1 || flag_menu==3 || flag_menu==3 || flag_menu==9) {
to_tray = 4;
} else
if(flag_menu == 0) {
to_tray = 1;
}
break;
case 'h':
help_window();
break;
case 't':
to_tray=1;
break;
default:
break;
}
// yaha ko to_tray value service menu bata auchha
if(to_tray == 3) {
help_window();
} else
if(to_tray == 1) {
break;
} else
if(to_tray ==4) {
show_menu();
}
if (log_stat==2) { break;}
}
if(log_stat == 2) { goto start_log;}
if(to_tray==1) {goto start_menu;}
return 0;
}
Server Code
/*
* main.c
* Server program for managing clients requests, settings etc.
*/
#include "function.h"
int main(){
HWND hwnd = GetConsoleWindow();
ShowWindow(hwnd,SW_MAXIMIZE);
console_settings();
console_resize(3);
login=fopen("save\\logins.dat","rb");
if(login==NULL)
admin_settings_signup();
else
admin_settings_signin();
main_menu();
start_socket();
start_server();
handleAccept = (HANDLE) _beginthread(thd_accept_connections,0,0);
handleMessages = (HANDLE) _beginthread(thd_program_messages,0,0);
//clientHandle = (HANDLE) _beginthread( thd_receive_data,0,0);
while(1){ // The interface part
switch(getch()){
case '1':
if(flag_menu==0)
requests();
else if(flag_menu==2)
services();
else if(flag_menu==21)
add_services();
else if(flag_menu==22)
setcost();
else if(flag_menu==24)
change_password();
break;
case '2':
if(flag_menu==0)
settings();
else if(flag_menu==2)
cost();
else if(flag_menu==22)
viewcost();
else if(flag_menu==21)
view_services();
break;
case '3':
if(flag_menu==0){
saveMessagesToFile();
exit(0);
}
else if(flag_menu==2)
member_settings_signup();
else if(flag_menu==21)
edit_services();
break;
case '4':
if(flag_menu==21)
search_services();
else if(flag_menu==2)
admin_settings();
break;
case '5':
if(flag_menu==21)
delete_services();
break;
case 'r':
if(flag_menu == 0)
flag_reset = true;
main_menu();
break;
case 27:
if(flag_menu==2 || flag_menu==1 )
main_menu();
else if(flag_menu==21)
settings();
else if( flag_menu==22)
settings();
else if(flag_menu==23)
settings();
else if(flag_menu==24)
settings();
else if(flag_menu==211)
services();
else if(flag_menu==212)
services();
else if(flag_menu==213)
services();
else if(flag_menu==214)
services();
else if(flag_menu==215)
services();
else if(flag_menu==221 || flag_menu==222)
cost();
break;
default:
break;
}
}
return 0;
}
Explaination
This Cyber Management System application was created using sophisticated C technologies such as socket programming and multithreading. The system is split into two parts: the client and the server.
The server module or software is in charge of managing client requests and settings. The client component, on the other hand, provides customers with online access to the location's services. Both programs are written in distinct languages and run in sync with one another.
As a result, the Cyber Cafe Management System links the many computers in a Cyber cafe and enables users to interact across the network. Its goal is to manage a Cyber cafe with several customers while also giving them service access to log in. The log-in mechanism protects the client server against hackers or unauthorized users gaining access.
Clients may log in as guests or members and utilize the cyber cafe's features in this cyber cafe management system project. Clients may also order normal café services like coffee, tea, and other items.
Output
Final Words
Although the project seems to be complicated, it is simple to comprehend and assess. It differs from the other C mini projects available on Code with C. If you have any questions, please leave them in the comments area.