论坛: 编程破解 标题: 怎么在xp系统里,使用Tc语言编程中输入中文 复制本贴地址    
作者: 如影随风 [ruying]    论坛用户   登录
请问有谁知道怎么在xp系统里,使用c语言编程中输入中文,以前在98中使用pdos95批处理可以,
用ucdos最新版的运行后直接就是全界面dos什么也不显示,有谁知道,到底要怎么做?


[此贴被 286(unique) 在 05月25日09时08分 编辑过]

地主 发表时间: 05-05-21 20:56

回复: 如影随风 [ruying]   论坛用户   登录
还有就是怎么在C语言编写出图形界面,要用什么函数,虽然我学的还没有到哪个地步,但我想尽快掌握,如果一次说不明白,请告诉我用什么函数,我自己去查~~~

B1层 发表时间: 05-05-21 21:14

回复: SysHu0teR [syshunter]   版主   登录
强烈建议现在的C初学者直接用VC。没必要非要循规蹈矩的从TC开始。最简单的例子是:
char *pstr=";aklsjdf;lkasdf";
pstr[3]='s';
初学者在TC下可能会心安理得的这么用

B2层 发表时间: 05-05-21 22:30

回复: peter [peter]   论坛用户   登录
    如果没有记错的话.是这个吧 initgraph

B3层 发表时间: 05-05-22 02:31

回复: peter [peter]   论坛用户   登录
      呵呵..我找到了一个我N年前学C时候写的一个好像是房间管理的吧..(翻出来看了几眼,好像还没有写完的样子,不过可以运行)我想我当时应该写得很苦吧..呵呵~~~~~(乱得要命)
是图形界面的...我把它贴上来(希望不会被人骂),,把下面几个文件复下来放到"c:\tc\"下,,,
还要建一个名为:roomdate.dat的空文件,不然好像个出错的(这是个用来装数据的文件,当时好像没有确定对这个文件的是否存在怎出处理)
一,文件名:index
/******主文件******************////
#include "c:\tc\menu.c"
#include "c:\tc\bookin.c"
#include "c:\tc\bookout.c"
#include "c:\tc\list.c"
main()
{  int choose;
do {
  choose=1;
  choose=view_menu();
    switch(choose)
    { case 1: view_in(); closegraph(); break;
      case 2: view_out(); closegraph(); break;
      case 3: view_list(); closegraph(); break;
    /* case 4: break;  */
      case 5: choose=0;break;
    }
}while(choose);
}
二,menu
/*************主菜单************/
#include <graphics.h>
#define REGX1 250
#define REGX2 400
#define REGY1 150
#define REGY2 175
#define MOVE (REGY2-REGY1)
#define MENT1 "1. Book  in"
#define MENT2 "2. Book  out"
#define MENT3 "3. Demand  "
#define MENT4 "4............. "
#define MENT5 "5. Exit system  "
#define MENTSUM 5
void view_win();
int view_menu()
{ int x1=REGX1,x2=REGX2,y1=REGY1,y2=REGY2,gd=DETECT,gm,chose=1;
  int m1=x1+20,m2=y1+15,ck=0;
  int clearx1=x1,clearx2=x2,cleary1=y1,cleary2=y2;
  long key;
  initgraph(&gd,&gm,"");
  view_win();
  setbkcolor(ck);
  setcolor(13);
  setfillstyle(1,4);
  settextstyle(8,0,1);
  for(;;)
  {
    setfillstyle(1,ck);
    bar(clearx1,cleary1,clearx2,cleary2);
    clearx1=x1;cleary1=y1;clearx2=x2;cleary2=y2;
    setfillstyle(1,9);
    bar(x1,y1,x2,y2);
    outtextxy(m1,m2,MENT1);
    outtextxy(m1,(m2+MOVE),MENT2);
    outtextxy(m1,(m2+2*MOVE),MENT3);
    outtextxy(m1,(m2+3*MOVE),MENT4);
    outtextxy(m1,m2+4*MOVE,MENT5);
    nosound();
    key=bioskey(0);
    sound(1500);
    switch(key)
{
  case 0x231:
  case 0x4f31:y1=REGY1,y2=REGY2,chose=1;break;
  case 0x332:
  case 0x5032:y1=REGY1+MOVE,y2=REGY2+MOVE,chose=2;break;
  case 0x433:
  case 0x5133:y1=REGY1+2*MOVE,y2=REGY2+2*MOVE,chose=3;break;
  case 0x534:
  case 0x4b34:y1=REGY1+3*MOVE,y2=REGY2+3*MOVE,chose=4;break;
  case 0x635:
  case 0x4c35:y1=REGY1+4*MOVE,y2=REGY2+4*MOVE,chose=5;break;
}
    if (y1>=REGY1 && y1<=REGY1+4*MOVE)
{
  if (key==0x4800) y1-=MOVE,y2-=MOVE,chose--;
  if (key==0x5000) y1+=MOVE,y2+=MOVE,chose++;
}
    if (y1<REGY1) y1=REGY1,y2=REGY2; else if (y2>REGY1+(MENTSUM-1)*MOVE) y1=REGY1+(MENTSUM-1)*MOVE,y2=REGY2+(MENTSUM-1)*MOVE;
    if (key==0x1c0d) break;

    }
  closegraph();nosound();
    return(chose);

}
void view_win()
{  int vx1=0,vy1=477,vx2=637,vy2=479; /*  lx=500,ly=0; */

  setcolor(4);
  setfillstyle(7,8);
  setlinestyle(0,0,3);
  line(0,300,639,300);
  setlinestyle(0,0,1);
  line(0,304,639,304);
  for(;vy1>305;)
    { vx1+=6;vx2-=6;vy1-=2;vy2-=2;
      bar(vx1,vy1,vx2,vy2);
    }
  setlinestyle(0,0,2);
  setcolor(9);
  circle(60,120,45);
  line(60,120,120,45);line(120,45,450,45);line(450,45,500,65);
  settextstyle(1,0,3);
  setcolor(14);
  outtextxy(160,100,"->Welcome use Room system<-");


}
三,文件名:list
#include <stdio.h>
#include <graphics.h>
#include <bios.h>
#define NULL 0
struct roomdate2
{  char number[6];
    char name[19];
    char id[20];
    char sex[2];
};
struct roomdate2 room2[200];



void view_find2();
void view_finderror2();
void view_window2();
void view_choose2();
void view_opener();
int len=0;
void main()
{ int gd=DETECT,gm;

  FILE *fp;
  int i=0,k=2,j=5,list=0,br=1,br1=1,br2=0,choose=0,menu=1;
  long key;
  initgraph(&gd,&gm,"");
  cleardevice();
  if ((fp=fopen("roomdate.dat","rb"))==NULL) {  view_opener();return;}
    while(!feof(fp))
    { fread(&room2[i++],sizeof(struct roomdate2),1,fp); len++;}
  len-=1;
  gotoxy(k,j);
  view_window2();

    i=0;
do {
      switch(choose)
{
  case 1: while(i<len && br && i>=0 && choose==1)
    { gotoxy(k,j+=2);
      printf("%6s%20s%21s%4s",room2[i].number,room2[i].name,room2[i].id,room2[i].sex);
      i++;
  if ((list++)>=9)
{  ; j=5;
    br=0;
    gotoxy(k,j);
}
    }break;
    case 2:  if (br2) view_find2();br2=0;break;
    case 3: return;

  }
    key=bioskey(0);
switch(key)
{  case 0x4900:if(i>=20)
  { i-=20-10+list;setfillstyle(1,getbkcolor());bar(12,90,635,419);br=1;j=5;list=0;}break;
  case 0x5100: if(i<len)
{ br=1;
  setfillstyle(1,getbkcolor());bar(12,90,635,419);list=0;}
break;
  case 0x1c0d: choose=menu;br2=1;i=0;br=1;j=5;list=0;break;
  case 0x4b00: if (menu>1) {menu--;view_choose2(menu);}break;
  case 0x4d00: if (menu<3) {menu++;view_choose2(menu);}break;

}

  }while(br1);

  fclose(fp);
}





void view_find2()
{  long key; int br=1,br1,choose,k,j,i,f;
  char date2[20];
  br=1;br1=0;choose=1;k=2;j=5;
  setfillstyle(1,getbkcolor());bar(12,90,635,419);
  setcolor(9);
  outtextxy(108,36,"Find");
  setlinestyle(0,0,0);
  rectangle(93,55,153,73);setcolor(13);outtextxy(103,61,"Number");setcolor(9);
  rectangle(93,73,153,91);outtextxy(108,80,"Name");
  rectangle(93,91,153,109);outtextxy(108,98,"ID");
do{
    key=bioskey(0);
    setcolor(9);
  outtextxy(103,61,"Number");outtextxy(108,80,"Name");outtextxy(108,98,"ID");
    setcolor(13);
    switch(key)
    { case 0x4800: if(choose>1) choose--;break;
      case 0x5000: if(choose<3) choose++;break;
      case 0x1c0d: br=0; f=choose; break;
  default: setcolor(13);outtextxy(108,36,"Find");setfillstyle(1,getbkcolor());bar(93,55,153,109);
  setfillstyle(1,getbkcolor());bar(12,90,635,419); return;
    }
  switch(choose)
  { case 1: outtextxy(103,61,"Number");break;
    case 2: outtextxy(108,80,"Name"); break;
    case 3: outtextxy(108,98,"ID");break;
  }
  }while(br);
  setfillstyle(1,getbkcolor());
  bar(12,90,635,419);
  bar(93,55,153,109);
  bar(235,30,334,48);
  setcolor(3);
  switch(choose)
  { case 1: outtextxy(235,36,"Enter Number:");break;
    case 2: outtextxy(248,36,"Enter Name:");break;
    case 3: outtextxy(260,36,"Enter ID:");break;
  }
loop:
  setlinestyle(0,0,0);
  setcolor(13);
  rectangle(335,30,510,48);
  setcolor(9);
  outtextxy(515,36,"<Enter>");outtextxy(585,36,"<Exit>");
  gotoxy(45,3);
  gets(date2);
  if (!strlen(date2)) goto endfind;
  setcolor(1);
  rectangle(335,30,510,48);
  setcolor(13);
  outtextxy(515,36,"<Enter>");
  br=1;
  do{
      key=bioskey(0);
      switch(key)
      { case 0x4b00:  setcolor(13);outtextxy(515,36,"<Enter>");setcolor(1);outtextxy(585,36,"<Exit>");choose=1;break;
case 0x4d00:  setcolor(1);outtextxy(515,36,"<Enter>");setcolor(13);outtextxy(585,36,"<Exit>");choose=0;break;
case 0x1c0d: br=0;break;
      }
      }while(br);
    if (!choose || !strlen(date2)) { setfillstyle(1,getbkcolor()); bar(235,30,635,48);setcolor(13);outtextxy(108,36,"Find"); return; }
    if(f==1) for(i=0;i<=len;i++)
{  if(!strcmp(date2,room2[i].number))
    { gotoxy(k,j+=2);br1=1;
      printf("%6s%20s%21s%4s",room2[i].number,room2[i].name,room2[i].id,room2[i].sex);
    }

  }
    else if(f==2) for(i=0;i<=len;i++)
    {  if(!strcmp(date2,room2[i].name))
      { gotoxy(k,j+=2); br1=1;
  printf("%6s%20s%21s%4s",room2[i].number,room2[i].name,room2[i].id,room2[i].sex);
}

    }
else for(i=0;i<=len;i++)
{  if(!strcmp(date2,room2[i].id))
    { gotoxy(k,j+=2); br1=1;
      printf("%6s%20s%21s%4s",room2[i].number,room2[i].name,room2[i].id,room2[i].sex);
    }

  }
    setfillstyle(1,getbkcolor());bar(336,31,509,47);
      if (!br1) view_finderror2();
    br=1; choose=1;
  do{
      key=bioskey(0);
      switch(key)
      { case 0x4b00:  setcolor(13);outtextxy(515,36,"<Enter>");setcolor(1);outtextxy(585,36,"<Exit>");choose=1;break;
case 0x4d00:  setcolor(1);outtextxy(515,36,"<Enter>");setcolor(13);outtextxy(585,36,"<Exit>");choose=0;break;
case 0x1c0d:  br=0;break;
      }
      }while(br);
      if (choose) goto loop;
endfind:    setfillstyle(1,getbkcolor()); bar(235,30,635,48);setcolor(13);outtextxy(108,36,"Find");
            setfillstyle(1,getbkcolor());bar(12,90,635,419);
}


void view_finderror2()
{  setfillstyle(1,9);
  setlinestyle(0,0,3);
  setcolor(9);
  rectangle(205,180,355,275);
  setlinestyle(0,0,0);
  bar(205,180,355,275);
  setfillstyle(1,0);
  bar(208,195,352,272);
  settextstyle(2,0,2);
  setcolor(7);
  outtextxy(210,183,"Find...");
  settextstyle(0,0,0);
  setcolor(9);
  outtextxy(240,220,"Not find !");
  rectangle(248,245,309,265);
  setcolor(13);
  outtextxy(259,252,"Enter");
  getch();
  setfillstyle(1,getbkcolor());
  bar(203,178,357,277);
  }


void view_window2()
{ setlinestyle(0,0,3);
  setcolor(1);
  setfillstyle(1,1);
  rectangle(1,6,638,466);
  bar(1,6,638,26);
  setlinestyle(0,0,0);
  line(1,51,638,51);
  line(1,434,638,434);
  setcolor(7);
  outtextxy(12,12,"Book in list && Find...");
  setcolor(9);
  rectangle(13,30,73,48); rectangle(93,30,153,48); rectangle(173,30,233,48);
  setcolor(13);outtextxy(28,36,"List");setcolor(9); outtextxy(108,36,"Find"); outtextxy(188,36,"Exit");
  setcolor(14);
  outtextxy(15,70,"Number              Name              ID      Sex    Book in time");
  setcolor(12);
  outtextxy(15,445,"[<-  ->] Choose    [page up] page up  [page down] page down");

}

void view_choose2(int ch)
{
  setcolor(9);outtextxy(28,36,"List");outtextxy(108,36,"Find");outtextxy(188,36,"Exit");
  setcolor(13);
  switch(ch)
  { case 1: outtextxy(28,36,"List"); break;
    case 2: outtextxy(108,36,"Find");break;
    case 3: outtextxy(188,36,"Exit");break;
  }
}
void view_opener()
{  setfillstyle(1,9);
  setlinestyle(0,0,3);
  setcolor(9);
  rectangle(200,180,350,275);
  setlinestyle(0,0,0);
  bar(200,180,350,275);
  setfillstyle(1,0);
  bar(203,195,347,272);
  settextstyle(2,0,2);
  setcolor(7);
  outtextxy(205,183,"Open file error..");
  settextstyle(0,0,0);
  setcolor(9);
  outtextxy(230,220,"Not Room date!");
  outtextxy(210,215,"      ");
  rectangle(243,245,304,265);
  setcolor(13);
  outtextxy(254,252,"Enter");
  getch();
  setfillstyle(1,getbkcolor());
  bar(198,178,352,277);
  }

四,文件:bookin
#include <stdio.h>
#include <graphics.h>
#include <string.h>
#include <bios.h>
struct roomdate1
{ char number[6];
  char name[19];
  char id[20];
  char sex[2];
};
int view_window1();
int view_listchoose();
int view_chk();
void view_nuer();
struct roomdate1 date[200];
struct roomdate1 room;
void view_in()
{
    FILE *fp;
    int i,gd=DETECT,gm,ch=1,choose;
    initgraph(&gd,&gm,"");
for(;ch;){
    cleardevice();
    choose=view_window1();
    if (!choose) return;
  gotoxy(38,10);setcolor(14); rectangle(288,135,348,160); gets(room.number);setcolor(3);rectangle(288,135,348,160);
  if (view_chk()) continue;
  gotoxy(38,13);setcolor(14); rectangle(288,180,438,208); gets(room.name); setcolor(3);rectangle(288,180,438,208);
  gotoxy(38,16);setcolor(14); rectangle(288,230,438,258); gets(room.id); setcolor(3);rectangle(288,230,438,258);
  gotoxy(38,19);setcolor(14); rectangle(288,282,320,305); gets(room.sex);
  choose=view_listchoose();
  if (choose==3) return;
      else if (choose==2) continue;
  if (strlen(room.number)>5 || strlen(room.name)>18 || strlen(room.id)>19 || strlen(room.sex)>1)
      ch=view_error();
      else {
      if ((fp=fopen("roomdate.dat","ab"))==NULL)
{ printf("\n opne file error");exit(0);}
      fwrite(&room,sizeof(struct roomdate1),1,fp);
      fclose(fp);
ch=view_reset();  }
  }
  restorecrtmode();
}



int view_error()
{ int er_number,choose=0;
  long key;
  char er_str[20]={"Error.!"};
  settextstyle(0,0,0);
/*  if (strlen(chk.number>5)) er_number=1;
  if (strlen(chk.>name>18)) er_number=2;
  if (strlen(chk.>id>19)) er_number=3;
  switch (er_number)
    {  case 1: er_str={"room number error."};break;
      case 2: er_str={"name error."}; break;
      case 3: er_str={"id error."}; break;
      case 4:break;
    }            */
    setfillstyle(1,4);
    setcolor(4);
    bar(250,240,500,335);
    setfillstyle(1,7);
    bar(253,250,497,333);
    outtextxy(298,265,er_str);
    setfillstyle(1,9);
    bar(300,308,350,328);
    setfillstyle(1,8);
    bar(395,308,445,328);
    outtextxy(310,315,"Enter");
    outtextxy(405,315,"Reset");
    for(;;)  {
    key=bioskey(0);
    if (key==0x4b00)
    { setfillstyle(1,9);bar(300,308,350,328);
      setfillstyle(1,8);bar(395,308,445,328);
choose=0; }
      else if (key==0x4d00)
  { setfillstyle(1,9);bar(395,308,445,328);
    setfillstyle(1,8);bar(300,308,350,328);
    choose=1; }
  else if(key==0x1c0d) return(choose);
outtextxy(310,315,"Enter");
outtextxy(405,315,"Reset");
    }

}
int view_reset()
{    char str[]={"The book in is OK."},str1[]={"Are you continue!"};
    int choose=0;
    long key;
    setfillstyle(1,9);
    settextstyle(0,0,0);
    setcolor(2);
    bar(250,240,500,335);
    setfillstyle(1,8);
    bar(253,250,497,333);
    outtextxy(298,265,str);
    outtextxy(298,275,str1);
    setfillstyle(1,9);
    bar(300,308,350,328);
    setfillstyle(1,8);
    bar(395,308,445,328);
    outtextxy(310,315,"Enter");
    outtextxy(405,315,"Next");
    for(;;)  {
    key=bioskey(0);
    if (key==0x4b00)
    { setfillstyle(1,9);bar(300,308,350,328);
      setfillstyle(1,8);bar(395,308,445,328);
choose=0; }
      else if (key==0x4d00)
  { setfillstyle(1,9);bar(395,308,445,328);
    setfillstyle(1,8);bar(300,308,350,328);
    choose=1; }
  else if(key==0x1c0d) return(choose);
outtextxy(310,315,"Enter");
outtextxy(405,315,"Next");
    }
}
int view_window1()
{  char ro[]={"Room number:"},na[]={"Name:"},id[]={"ID:"},se[]={"Sex:"};
  int choose,br;
  long key;
  setlinestyle(0,0,3);
  setcolor(1);
  setfillstyle(1,1);
  rectangle(1,6,638,466);
  bar(1,6,638,26);
  setlinestyle(0,0,0);
  line(1,51,638,51);
  setcolor(7);
  outtextxy(12,12,"Book in list...");
  setcolor(9);
  rectangle(35,30,95,48); rectangle(115,30,175,48);
  setcolor(13);outtextxy(45,36,"Enter"); setcolor(9);outtextxy(130,36,"Exit");
  rectangle(215,360,275,378); rectangle(295,360,355,378); rectangle(375,360,435,378);
  outtextxy(225,366,"Enter"); outtextxy(305,366,"Reset"); outtextxy(390,366,"Exit");

    setcolor(14);
    settextstyle(0,0,0);
    outtextxy(190,150,ro);
    outtextxy(245,196,na);
    outtextxy(260,242,id);
    outtextxy(255,288,se);
    setcolor(3);
    rectangle(288,135,348,160);
    rectangle(288,180,438,208);
    rectangle(288,230,438,258);
    rectangle(288,282,320,305);

  br=1;
  do{
    key=bioskey(0);
    switch(key)
      { case 0x4b00: choose=1;setcolor(13);outtextxy(45,36,"Enter"); setcolor(9);outtextxy(130,36,"Exit"); break;
case 0x4d00: choose=0;setcolor(9);outtextxy(45,36,"Enter"); setcolor(13);outtextxy(130,36,"Exit"); break;
case 0x1c0d: br=0; break;
      }


    } while(br);
    setcolor(9);outtextxy(45,36,"Enter"); outtextxy(130,36,"Exit");
    return(choose);


}
int view_listchoose()
{ int choose=1,br=1;
  long key;
setcolor(13);outtextxy(225,366,"Enter");
  do{
  key=bioskey(0);
    switch(key)
  {  case 0x4d00: if(choose<3) choose++; break;
      case 0x4b00: if(choose>1) choose--; break;
      case 0x1c0d: br=0; break;
  }setcolor(9);
  outtextxy(225,366,"Enter"); outtextxy(305,366,"Reset"); outtextxy(390,366,"Exit");
  setcolor(13);
  if(br)
      switch(choose)
    { case 1:  outtextxy(225,366,"Enter"); break;
      case 2:  outtextxy(305,366,"Reset"); break;
      case 3:  outtextxy(390,366,"Exit"); break;
    }
    } while(br);
    setcolor(9); outtextxy(225,366,"Enter"); outtextxy(305,366,"Reset");outtextxy(390,366,"Exit");
    return(choose);
}
int view_chk()
{
int j,i,choose;
  FILE *fp;
  fp=fopen("roomdate.dat","ab+");
  rewind(fp);
  for(i=0;!feof(fp);i++)
      fread(&date[i],sizeof(struct roomdate1),1,fp);
  fclose(fp);
  for(j=0;j<=i;j++)
      if(!strcmp(room.number,date[j].number))  break;
  if(j<i) {choose=1; view_nuer();}
      else choose=0;

  return(choose);
}
void view_nuer()
{  setfillstyle(1,9);
  setlinestyle(0,0,3);
  setcolor(9);
  rectangle(200,180,350,275);
  setlinestyle(0,0,0);
  bar(200,180,350,275);
  setfillstyle(1,0);
  bar(203,195,347,272);
  settextstyle(2,0,2);
  setcolor(7);
  outtextxy(205,183,"Room number...");
  settextstyle(0,0,0);
  setcolor(9);
  outtextxy(235,220,"The Room in !");
  outtextxy(210,215,"      ");
  rectangle(243,245,304,265);
  setcolor(13);
  outtextxy(254,252,"Enter");
  getch();
  setfillstyle(1,getbkcolor());
  bar(198,178,352,277);
  }

五,文件名:bookout
#include <graphics.h>
#include <string.h>
#include <stdio.h>
#include <bios.h>
#include <ctype.h>
#define NULL 0
struct roomdate3
{ char number[6];
  char name[19];
  char id[20];
  char sex[2];
};
struct roomdate3 date3[200];
void view_window3();
void view_finderror3();
void view_opener3();
int view_masge();
int view_error3();
int view_listdat();
char number[6];
void view_out()
{ int gd=DETECT,gm,choose,br,i=0;
  long key;

  initgraph(&gd,&gm,"");
loop: 
do{  br=0;choose=1;
  view_window3();
  gotoxy(19,3);
  gets(number);
  for(i=0;number[i];i++)
  if (!isalnum(number[i]) || i>4) {br=1;break;}
  if (i==0) br=1;
  if (br) {br=view_error3();if (!br) return;}
  }while(br);
  setcolor(9);rectangle(115,29,250,49);setcolor(13);outtextxy(295,36,"Enter");
  br=1;
  do{
  key=bioskey(0);
    switch(key)
  {  case 0x4d00: if(choose<3) choose++; break;
      case 0x4b00: if(choose>1) choose--; break;
      case 0x1c0d: br=0; break;
      case 0x11b: return;
  }setcolor(9);
  outtextxy(295,36,"Enter"); outtextxy(375,36,"Reset"); outtextxy(460,36,"Exit");
  setcolor(13);
  if(br)
      switch(choose)
    { case 1:  outtextxy(295,36,"Enter"); break;
      case 2:  outtextxy(375,36,"Reset"); break;
      case 3:  outtextxy(460,36,"Exit"); break;
    }
    } while(br);
  switch(choose)
      { case 1:  if(!view_masge(number)) break;
case 2:  goto loop;
case 3:  return;

      }
}



int view_masge()
{
  int j,i,k,choose;
  FILE *fp;
  if((fp=fopen("roomdate.dat","rb"))==NULL) {view_opener3();return;}
  for(i=0;!feof(fp);i++)
      fread(&date3[i],sizeof(struct roomdate3),1,fp);
    fclose(fp);
    i--;
  for(j=0;j<=i;j++)
      if(!strcmp(number,date3[j].number)) { choose=view_listdat(j); break;}
  if(j>i) {choose=1;view_finderror3();return(choose);}
  for(k=j;k<i;k++)
      date3[k]=date3[k+1];
  i--;
  fp=fopen("roomdate.dat","wb");
  fwrite(date3,sizeof(struct roomdate3),i,fp);
  fclose(fp);
  return(choose);
}




void view_window3()
{ setlinestyle(0,0,3);
  setcolor(1);
  setfillstyle(1,1);
  rectangle(1,6,638,466);
  bar(1,6,638,26);
  setlinestyle(0,0,0);
  line(1,51,638,51);
  setcolor(7);
  outtextxy(12,12,"Book out...");
  setcolor(13);
  outtextxy(13,36,"Room number:");
  setfillstyle(1,getbkcolor());bar(116,30,549,48);
  setcolor(13);
  rectangle(115,29,250,49);
  setcolor(9);
  rectangle(285,30,345,48); rectangle(365,30,425,48); rectangle(445,30,505,48);
  outtextxy(295,36,"Enter"); outtextxy(375,36,"Reset"); outtextxy(460,36,"Exit");
}
int view_error3()
{    char str[]={"Enter date ERROR!"},str1[]={"Are you Reset or Exit!"};
    int choose=1;
    long key;
    setfillstyle(1,9);
    setcolor(15);
    bar(250,240,500,335);
    settextstyle(2,0,2);
    outtextxy(254,242,"Error");
    settextstyle(0,0,0);
    setcolor(6);
    setfillstyle(1,0);
    bar(253,250,497,333);
    outtextxy(298,265,str);
    outtextxy(298,275,str1);
    setfillstyle(1,9);
    bar(300,308,350,328);
    setfillstyle(1,8);
    bar(395,308,445,328);
    outtextxy(307,315,"Reset");
    outtextxy(405,315,"Exit");
    for(;;)  {
    key=bioskey(0);
    if (key==0x4b00)
    { setfillstyle(1,9);bar(300,308,350,328);
      setfillstyle(1,8);bar(395,308,445,328);
choose=1; }
      else if (key==0x4d00)
  { setfillstyle(1,9);bar(395,308,445,328);
    setfillstyle(1,8);bar(300,308,350,328);
    choose=0; }
  else if(key==0x1c0d) {setfillstyle(1,getbkcolor()); bar(250,240,500,335); return(choose); }
outtextxy(307,315,"Reset");
outtextxy(405,315,"Exit");
    }
}

int view_listdat(int i)
{  long key;
  int choose=0,br=1;
  setcolor(14);
  outtextxy(164,180,"Room number:");
  outtextxy(220,205,"Name:");
  outtextxy(236,230,"Id:");
  outtextxy(228,255,"Sex:");
  outtextxy(140,280,"Book in time:");
  outtextxy(132,305,"Book out time:");
  outtextxy(180,330,"Expense:");
  setcolor(3);
  outtextxy(265,180,date3[i].number);
  outtextxy(265,205,date3[i].name);
  outtextxy(265,230,date3[i].id);
  outtextxy(265,255,date3[i].sex);
  setcolor(13);
  outtextxy(225,360,"{<Enter>}");setcolor(9);outtextxy(310,360,"{<Reset>}");
  do{
    key=bioskey(0);

    setcolor(9);
    outtextxy(225,360,"{<Enter>}");outtextxy(310,360,"{<Reset>}");
    setcolor(13);
    switch(key)
    { case 0x4b00: choose=0;outtextxy(225,360,"{<Enter>}");break;
      case 0x4d00: choose=1;outtextxy(310,360,"{<Reset>}");break;
      case 0x1c0d: br=0;break;
      }
    }while(br);
    setfillstyle(1,getbkcolor());bar(100,170,400,370);
    return(choose);


}
void view_finderror3()
{  setfillstyle(1,9);
  setlinestyle(0,0,3);
  setcolor(9);
  rectangle(200,180,350,275);
  setlinestyle(0,0,0);
  bar(200,180,350,275);
  setfillstyle(1,0);
  bar(203,195,347,272);
  settextstyle(2,0,2);
  setcolor(7);
  outtextxy(205,183,"Find...");
  settextstyle(0,0,0);
  setcolor(9);
  outtextxy(235,220,"Not find !");
  outtextxy(210,215,"      ");
  rectangle(243,245,304,265);
  setcolor(13);
  outtextxy(254,252,"Enter");
  getch();
  setfillstyle(1,getbkcolor());
  bar(198,178,352,277);
  }
void view_opener3()
{  setfillstyle(1,9);
  setlinestyle(0,0,3);
  setcolor(9);
  rectangle(200,180,350,275);
  setlinestyle(0,0,0);
  bar(200,180,350,275);
  setfillstyle(1,0);
  bar(203,195,347,272);
  settextstyle(2,0,2);
  setcolor(7);
  outtextxy(205,183,"Open file error..");
  settextstyle(0,0,0);
  setcolor(9);
  outtextxy(230,220,"Not Room date!");
  outtextxy(210,215,"      ");
  rectangle(243,245,304,265);
  setcolor(13);
  outtextxy(254,252,"Enter");
  getch();
  setfillstyle(1,getbkcolor());
  bar(198,178,352,277);
  }




[此贴被 peter(peter) 在 05月22日03时14分 编辑过]

B4层 发表时间: 05-05-22 02:48

回复: 如影随风 [ruying]   论坛用户   登录
我说怎么弄中文的~~~老看英文的不习惯啊,~!!

B5层 发表时间: 05-05-24 22:30

回复: peter [peter]   论坛用户   登录
    呵~~~~看来我做了很多余的事,,,,
不用我在XP里用usdos.是可以显示中文的.-----SP2就不确定了

B6层 发表时间: 05-05-24 23:44

回复: 墨尔本的翡翠 [djlamcomcn]   论坛用户   登录
用ASP程序破

B7层 发表时间: 05-07-18 21:33

回复: wazyxm [wazyxm]   论坛用户   登录
在微软的UCDOS下可以实现   

B8层 发表时间: 05-10-22 21:33

回复: jhkdiy [jhkdiy]   版主   登录
我也建议直接用Vc,我学校这个学期的C语言也是用TC来编译的,但在我的说服下,老师同意全班用Win-TC,一方面为了和课本兼容,另一方面方便大家入门。因为现在的NT系统对Tc支持不好。而且TC也是老家伙了,有汽车就没必要再用单车了。

B9层 发表时间: 05-10-23 12:43

回复: xtsyiu [xtsyiu]   论坛用户   登录
我建义把英语学好

B10层 发表时间: 05-11-05 15:12

论坛: 编程破解

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号