❶ 學生信息管理系統的學生登錄界面做成C/S結構,要怎麼通過聯網訪問資料庫(資料庫與學生登錄程序不在一台機
C/S系統本來就是伺服器-客戶機模式,直接就支持區域網訪問資料庫。
比如說你用c語言或者Java或者其他什麼語言,製作窗口程序界面,輸入、查詢等界面。然後單獨寫一個連接資料庫的連接,你可以通過ODBC也可以通過ADO等多種資料庫訪問方式,資料庫連接好之後,所有的操作可以通過寫sql語句也可以用資料庫控制項來獲得。這個和你使用的開發語言有關
最關鍵的是,在區域網訪問資料庫,需要在連接資料庫時,寫上IP地址或者主機名稱,另外一定要選用sql server等非單機資料庫,至少access不行。
具體操作和代碼,每種語言的書里都有很詳細的,我只是把這種模式的應用簡單給你描述一下,讓你思路清晰一點。
❷ 用C語言做 學生宿舍管理系統
孩子 很清楚這是老師給你的作業題 ,,知識是被網路不出來的,,強烈建議看到此題的同仁不給出答案,,,,孩子 你自己試著寫,,那不會,隨時問 我們會解答 但你這是直接問作業 那老師還讓你寫幹嘛???給你思路 那個合法才能進入,,只需要用個判斷句就行,先輸入密碼 正確 則繼續執行 錯誤 輸出提示信息,,當然 這里你可以加一點花招 連續輸入3次 直接退出程序或者等待1分鍾才行,,哈哈 這個你可以寫完不給老師說密碼,然後老師輸入,,哈哈 其他的的代碼就是鏈表的知識了 課本上也都有的,,,,,好好學習啊 中國需要腳踏實地的程序員,,不要投機取巧,,
❸ 如何用c語言程序編一個管理系統
結構定義如下,其他的自己寫吧,內容太多了
struct user_info {
char[10] user_code;
char[10] user_name;
char[10] passeord;
char user_limit;
}
❹ C語言程序的聯網指令怎麼寫
你是問socket嗎?你是要windows的還是linux的,這兩個有區別的。一般用戶空間的套接字,三中,流式套接字,數據包套接字,原始套接字前兩種分別對應TCP和UDP,第三種是用戶自己填寫skb,也就是數據包。TCP需要三次握手UDP是無連接的你問題具體一些,我再根據你說的回答你。
❺ 急求C語言學生成績管理系統怎麼連接資料庫
基於你的題目學生成績管理系統,我們可以提供一份代碼,適用於初學者的,
如有具體需求,可以我們聯系,,聯系我們需要提供你的問題和電子郵件,有時間可以幫你,絕對救急,使用網路_Hi給我留言,
此回復對於所有需求和和來訪者有效,
ES:\\
❻ c語言員工管理系統求教 急!!
樓主,我編出來了
第一次編這個,算算用了12個小時左右,汗~
程序如下
----------------------------------------------------
/*每個員工的信息包括:編號、姓名、性別、出生年月、學歷、職務、電話、住址等。系統能夠完成員工信息的查詢、更新、插入、刪除、排序等功能。
(1) 排序:按不同關鍵字,對所有員工的信息進行排序。
(2) 查詢:按特定條件查找員工。
(3) 更新:按編號對某個員工的某項信息進行修改。
(4) 插入:加入新員工的信息。
(5) 刪除:按編號刪除已離職的員工的信息。
(6) 程序要求操作方便,靈活。*/
#include <stdio.h>
#include <stdlib.h>
#include <windows.h> //清屏函數頭文件
#include <string.h>
struct Stuff
{
char number[10]; //員工編號
char name[10]; //員工姓名
char sex[8]; //員工性別
char borth[10]; //員工生日
char degree[20]; //員工學歷
char business[20]; //員工職務
char phone[15]; //員工電話
char place[50]; //員工住址
char con[50]; //判斷關鍵字專用
struct Stuff *next;
};
char Menu(void); //菜單顯示
struct Stuff *App(struct Stuff *head); //添加
void Sort(struct Stuff *head); //排序
struct Stuff *Ser(struct Stuff *head); //查找
void Chn(struct Stuff *head,char n[10]); //更改
void Scpy(char *p,char *q); //排序中用於交換員工信息
struct Stuff *Del(struct Stuff *head,char n[10]); //刪除
int Sel(char ch,struct Stuff *p,struct Stuff *q); //判斷排序及關鍵字專用函數
void Prf(struct Stuff *head); //輸出
void Fre(struct Stuff *head); //釋放
int i=1; //定義全局變數,實現實時員工人數統計
int main(void)
{
char n[10];
struct Stuff *head=NULL; //鏈表頭指針定義
while(1)
{
switch(Menu())
{
case '1':
printf("請輸入員工信息,直接輸入'#'結束\n");
head=App(head);
break;
case '2':
Sort(head);
break;
case '3':
head=Ser(head);
break;
case '4':
printf("員工信息如下:\n");
Prf(head);
break;
case '5':
printf("請輸入員工編號:");
scanf("%s",n);
Chn(head,n);
break;
case '6':
printf("請輸入員工編號:");
scanf("%s",n);
head=Del(head,n);
break;
case '0':
printf("歡迎下次光臨,88!\n");
exit(0);
default:
printf("輸入錯誤,請重新輸入!\n");
}
fflush(stdin); //清楚緩沖區
printf("按任意鍵繼續~");
getchar();
system("cls"); //清屏效果
}
Fre(head);
return 0;
}
//菜單函數
char Menu(void)
{
char ch;
printf("------------請選擇-----------\n");
printf("1.添加員工信息\n2.員工信息排序\n3.查找員工信息\n4.輸出員工信息\n5.更改員工信息\n6.刪除員工信息\n0.退出\n-----------------------------\n");
scanf(" %c",&ch);
return ch;
}
//添加成員函數
//輸入參數:鏈表頭指針
//返回參數:鏈表頭指針
struct Stuff *App(struct Stuff *head)
{
struct Stuff *p=NULL,*q=head;
while(i)
{
p=(struct Stuff *)malloc(sizeof(struct Stuff)); //申請結構體空間
if(p==NULL)
{
printf("內存不夠!\n");
exit(0);
}
p->next =NULL; //指針域為空
printf("請輸入第%d名員工:\n",i);
printf(" 編號 | 姓名 | 性別 | 出生年月 | 學歷 | 職務 | 電話 | 住址 :\n");
fflush(stdin);
scanf("%s",p->number );
if(!strcmp(p->number ,"#"))
{
free(p); //釋放不需要的結構體內存
break;
}
else
{
++i;
scanf("%s%s%s%s%s%s%s",p->name ,p->sex ,p->borth ,p->degree ,p->business ,p->phone ,p->place );
p->con[0]='\0'; //防止後面判斷出現隨機值
if(head==NULL)
head=p;
else
{
while(q->next !=NULL) //防止結束後再次輸入時出現問題
q=q->next ;
q->next =p;
}
q=p; //每次都加在鏈表尾
}
}
return head;
}
//排序函數
//輸入參數:頭指針
void Sort(struct Stuff *head)
{
char ch;
struct Stuff *p,*q,*r;
while(1)
{
printf("請選擇排序條件:1.編號2.姓名3.性別4.出生年月5.學歷6.職務7.電話8.地址0.退出\n");
scanf(" %c",&ch);
if(ch=='0')
break;
if(ch<'1'||ch>'8')
{
printf("輸入錯誤,請重新輸入!\n");
continue;
}
p=head;
while(p->next!=NULL) //選擇排序
{
q=p->next;
r=p;
while(q!=NULL)
{
if(Sel(ch,r,q)) //調用判斷函數
r=q;
q=q->next;
}
if(r!=p) //交換內容
{
Scpy(r->number,p->number);
Scpy(r->name,p->name);
Scpy(r->sex,p->sex);
Scpy(r->borth,p->borth);
Scpy(r->degree,p->degree);
Scpy(r->business,p->business);
Scpy(r->phone,p->phone);
Scpy(r->place,p->place);
}
p=p->next;
}
Prf(head); //輸出
}
}
//交換函數
void Scpy(char *p,char *q)
{
char c[50];
strcpy(c,p);
strcpy(p,q);
strcpy(q,c);
}
//判斷函數
//輸出參數:1為真,0為假
int Sel(char ch,struct Stuff *p,struct Stuff *q)
{
switch(ch) //實現各個關鍵字查找
{
case '1':
return strcmp(q->number ,p->number )<0||strcmp(q->con ,p->number )==0 ; //排序條件及查找條件
case '2':
return strcmp(q->name ,p->name )<0||strcmp(q->con ,p->name )==0 ;
case '3':
return strcmp(q->sex ,p->sex )<0||strcmp(q->con ,p->sex )==0 ;
case '4':
return strcmp(q->borth ,p->borth)<0 ||strcmp(q->con ,p->borth )==0 ;
case '5':
return strcmp(q->degree ,p->degree )<0||strcmp(q->con ,p->degree )==0 ;
case '6':
return strcmp(q->business ,p->business )<0||strcmp(q->con ,p->business)==0 ;
case '7':
return strcmp(q->phone ,p->phone )<0 ||strcmp(q->con ,p->phone)==0;
case '8':
return strcmp(q->place ,p->place )<0||strcmp(q->con ,p->place )==0;
default :
exit(0);
}
}
//查找函數
struct Stuff *Ser(struct Stuff *head)
{
struct Stuff *p=NULL,*q,a={"\0","\0","\0","\0","\0","\0","\0","\0"}; //防止判斷時錯誤
int flag; //查找判斷
char ch,sh;
q=&a;
while(1)
{
printf("請輸入要查找的條件:1.編號2.姓名3.性別4.出生年月5.學歷6.職務7.電話8.住址0.退出\n");
scanf(" %c",&ch);
if(ch=='0')
break;
if(ch<'1'||ch>'8')
{
printf("輸入錯誤,請重新輸入!\n");
continue;
}
fflush(stdin);
printf("請輸入:");
gets(q->con );
p=head; //指向表頭
flag=0;
while(p!=NULL)
{
if(Sel(ch,p,q))
{
printf("員工信息如下:\n");
printf(" 編號 | 姓名 | 性別 | 出生年月 | 學歷 | 職務 | 電話 | 住址 \n%s %s %s %s %s %s %s %s\n"
,p->number ,p->name ,p->sex ,p->borth ,p->degree ,p->business ,p->phone ,p->place );
printf("是否需要:1.更改 2.刪除 3.繼續\n");
scanf(" %c",&sh);
if(sh=='1')
Chn(head,p->number); //調用更改函數
else if(sh=='2')
head=Del(head,p->number); //調用刪除函數,得到的head必須return
flag=1;
break;
}
p=p->next ;
}
if(flag==0)
printf("沒有找到該員工信息!\n");
}
return head;
}
//更改函數
//輸入參數:n[10] 為員工編號
void Chn(struct Stuff *head,char n[10])
{
struct Stuff *p=head;
int flag=0;
if(head==NULL)
printf("未找到員工信息!\n");
else
{
while(p!=NULL)
{
if(!strcmp(p->number,n))
{
printf("請輸入新的信息:\n編號|姓名|性別|出生年月|學歷|職務|電話|住址\n");
scanf("%s%s%s%s%s%s%s%s",p->number ,p->name ,p->sex ,p->borth ,p->degree ,p->business ,p->phone ,p->place );
printf("員工信息如下:\n");
flag++;
break;
}
p=p->next;
}
if(flag==0)
printf("未找到該員工信息!\n");
}
Prf(head);
}
//刪除函數
//輸入參數:n為員工編號
//輸出參數:頭指針
struct Stuff *Del(struct Stuff *head,char n[10])
{
struct Stuff *p,*pr;
int flag;
flag=0;
p=head,pr=head;
if(head==NULL)
printf("未找到員工信息!\n");
else
{
while(strcmp(p->number ,n)&&p->next !=NULL)
{
pr=p;
p=p->next ;
}
if(!strcmp(p->number ,n))
{
if(p==head)
head=p->next ;
else
pr->next=p->next ;
free(p);
printf("刪除成功!\n");
i--;
}
else
printf("未找到員工信息!\n");
}
Prf(head);
return head;
}
//輸出函數
void Prf(struct Stuff *head)
{
struct Stuff *p=head;
int i=1;
while(p!=NULL)
{
printf("%d. %s %s %s %s %s %s %s %s\n"
,i++,p->number ,p->name ,p->sex ,p->borth ,p->degree ,p->business ,p->phone ,p->place);
p=p->next ;
}
}
//釋放函數
void Fre(struct Stuff *head)
{
struct Stuff *p;
while(head!=NULL)
{
p=head;
head=head->next ;
free(p);
}
}
❼ 在linux下,如果用C語言程序獲取網路利用那個率,類似於window系統任務管理器中的聯網,速求
linux有top(自帶的)工具,也有atop(需要下載的)工具,具體使用方法可以參考man手冊