今天是星期二,来DHC整好一周,已经习惯了上班实习的节奏,最明显的现象就是睡觉比在学校寝室时早很多,以前在寝室,基本从学院工作室回来已经晚上9点多了,回寝室之后再和同寝室兄弟掐(qia 二音)两把魔兽,再睡,一般11点之前能躺下算早的了,何况下铺的兄弟整个时间钟比我还晚几个小时,也就是基本上是后半夜睡第二天近中午时醒.在这边晚上基本9点就躺在床上了,因为电脑什么的都没带过来,没有什么事情可以做,索性早点睡觉吧.早上6:40醒,洗漱完毕后7:30出门,公车+城铁,下地铁口顺便拿一份地铁免费的报纸,到公司基本是8:10左右,吃早点8:20,接杯开水准备开始学习.
新系统平台的文档看了3/5了,估计明天就能搞定了,今天又学了一些新东西:
cdqt XML
渠道 .sql
cdht SPxxxx.c
根据传说貌似公司要开年会,150/人的待遇,不知道有没有实习的分:)
以前一直关注JAVA方面的技术,来这实习之后忽然转到了C,不得不看些C的资料了,哈哈,今天本想拿C做个仿银行终端的页面,可惜才疏学浅,于是在CSDN上DOWN了几个学习一下:
第一个:
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<dos.h>
#include<conio.h>
#define key_down 80
#define key_up 72
#define key_esc 1
#define key_alt_f 33
#define key_alt_x 45
#define key_enter 28
int get_key();
void box(int startx,int starty,int high,int width);
main()
{
int i,key,x,y,l;
char *menu[]={"File","Edit","Run","Options","Help",
"Setup","Zoom","Menu"};
char *red[]={"F","E","R","O","H","S","Z","M"};
char *f[]={"Load file",
"Save file",
"Print ",
"Modify ",
"Quit alt_x",};
char buf[16*10*2],buf1[16*2];
textbackground(1);
clrscr();
textmode(C80);
window(1,1,80,1);
textbackground(15);
textcolor(0);
clrscr();
window(1,1,80,1);
for(i=0,l=0;i<8;i++)
{
x=wherex();
y=wherey();
cprintf(" %s",menu[i]);
l=strlen(menu[i]);
gotoxy(x,y);
textcolor(RED);
cprintf(" %s",red[i]);
x=x+l+4;
gotoxy(x,y);
textcolor(BLACK);
}
while(1)
{
key=0;
while(bioskey(1)==0);
key=get_key();
if(key==key_alt_x)exit(0);
if(key==key_alt_f)
{
textbackground(0);
textcolor(15);
gotoxy(4,1);
cprintf("%s",menu[0]);
gettext(4,2,19,12,buf);
window(4,2,19,8);
textbackground(15);
textcolor(0);
clrscr();
window(4,2,19,9);
box(1,1,7,16);
for(i=2;i<7;i++)
{
gotoxy(2,i);
cprintf("%s",f[i-2]);
}
gettext(2,2,18,3,buf1);
textbackground(0);
textcolor(15);
gotoxy(2,2);
cprintf(" %s",f[0]);
y=2;
key=get_key();
while(key!=key_alt_x&&key!=key_enter&&key!=key_esc)
{
if(key==key_up||key==key_down)
{
puttext(2,y,18,y+1,buf1);
if(key==key_up)y=y==2? 6:y-1;
if(key==key_down)y=y==6? 2:y+1;
gettext(2,y,18,y+1,buf1);
textbackground(0);
textcolor(15);
gotoxy(2,y);
cprintf("%s",f[y-2]);
}
key=get_key();
}
if(key==key_alt_x)exit(0);
if(key==key_enter)
{
switch(y-1)
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
exit(0);
default:
break;
}
}
else
{
window(1,1,80,2);
puttext(4,2,19,12,buf);
textbackground(15);
textcolor(0);
gotoxy(4,1);
cprintf("%s",menu[0]);
}
}
}
}
int get_key()
{
union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;
}
void box(int startx,int starty,int high,int width)
{
int i;
gotoxy(startx,starty);
putch(0xda);
for(i=startx+1;i<width;i++)putch(0xc4);
putch(0xbf);
for(i=starty+1;i<high;i++)
{
gotoxy(startx,i);putch(0xb3);
gotoxy(width,i);putch(0xb3);
}
gotoxy(startx+1,width);
putch(0xc0);
for(i=startx+1;i<width;i++)putch(0xc4);
putch(0xd9);
return;
}
第二个:
#include "stdio.h"
#include "string.h"
#include "process.h"
#include "stdlib.h"
#include "dos.h"
#include "conio.h"
#include "bios.h"
#define DOWN 80
#define UP 72
#define ESC 1
#define ALT_F 33
#define ALT_X 45
#define ENTER 28
int getkey();
void box(int startx,int starty,int high,int width);
void main()
{
int i,key,x,y,l;
char *menu[]={"File","Edit","Run","Option","Help","Setup","Zoom","Menu"};
char *red[]={"F","E","R","O","H","S","Z","M"};
char *f[]={"Load File",
"Save File",
"Print ",
"Modify ",
"Quit Alt_X"};
char buf[16*10*2],buf1[16*2];/*定义保存文件的缓冲区*/
textbackground(LIGHTGREEN);/*定一窗口背景色*/
clrscr();
/*textmode(C80);*/
window(1,1,80,1);
textbackground(15);
textcolor(0);
clrscr();
window(1,1,80,2);/*define the window of showing the main menu*/
for(i=0,l=0;i<8;i++)
{x=wherex();/*get the position of current cursor*/
y=wherey();
cprintf(" %s",menu[i]);/*前面为四个空格*/
l=strlen(menu[i]);/*get the length of the menu[i]*/
gotoxy(x,y);
textcolor(RED);
cprintf(" %s",red[i]);/*red the first character of every menu[i]*/
x=x+l+4;
gotoxy(x,y);
textcolor(BLACK);/*为显示下一各菜单项移动光标*/
}
while(1)
{key=0;
while(bioskey(1)==0);/*等待按键*/
key=getkey();/*取按键少描码*/
if(key==ALT_X)exit(0);
if(key==ALT_F)
{textbackground(0);
textcolor(15);
gotoxy(4,1);
cprintf("%s",menu[0]);/*加黑FILE项*/
gettext(4,2,19,12,buf);/*保存窗口原来得文本*/
window(4,2,19,8);
textbackground(7);
textcolor(0);
clrscr();
window(4,2,19,8);
box(1,1,7,16);/*调用作框函数*/
for(i=2;i<7;i++)/*显示各子菜单项*/
{gotoxy(2,i);
cprintf("%s",f[i-2]);
}
gettext(2,2,18,3,buf1);
textbackground(0);
textcolor(15);
gotoxy(2,2);
cprintf("%s",f[0]);
y=2;
while(bioskey(1)==0);/*等待按键??*/
key=getkey();/*wait for entering key*/
while(key!=ALT_X&&key!=ENTER&&key!=ESC)/*是ALT_X,ENTER,ESC时退出*/
{if(key==UP||key==DOWN)
{puttext(2,y,18,y+1,buf1);/*恢复原来得项*/
if(key==UP)y=y==2?6:y-1;
if(key==DOWN)y=y==6?2:y+1;
gettext(2,y,18,y+1,buf1);/*保存要压上光条得子菜单项*/
textbackground(0);
textcolor(15);
gotoxy(2,y);
cprintf("%s",f[y-2]);/*产生黑条压在所选项上*/
}
key=getkey();
}
if(key==ALT_X)exit(0);
if(key==ENTER)
{switch(y-1)
{case 1:break;/*load file*/
case 2:break;/*save file*/
case 3:break;/*print*/
case 4:break;
case 5:exit(0);
default:break;
}
}
else/*是ESC键,返回主菜单*/
{window(1,1,80,2);
puttext(4,2,19,12,buf);
textbackground(15);
textcolor(0);
gotoxy(4,1);
cprintf("%s",menu[0]);
}
}
}
}
int getkey()/*get 扫描码*/
{union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;
}
void box(int startx,int starty,int high,int width)
{int i;
gotoxy(startx,starty);
putch(0xda);
for(i=startx+1;i<width;i++)putch(0xc4);
putch(0xbf);
for(i=starty+1;i<high;i++)
{gotoxy(startx,i);putch(0xb3);
gotoxy(width,i);putch(0xb3);
}
gotoxy(startx+1,width);
putch(0xc0);
for(i=startx+1;i<width;i++)putch(0xc4);
putch(0xd9);
return;
}