?? show.cpp
字號:
#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<stdlib.h>
#include<windows.h>
#include <time.h>
void load(); /*加載聊天信息*/
void exi(); /*進程監控功能前半段*/
char temp[255]="zhangzehua"; /*初始化聊天信息*/
char test[255]; /*聊天信息內容變量*/
int pd=0;
main()
{
system("title 聊天信息-C chat system Client");
for(;;)
{load(); exi(); Sleep(100);}
}
void load()
{
long num=0,i;
FILE *fp,ffp;
int k;
char tt[255];
if(pd>=20)
system("title 聊天信息-C chat system Client");
if((fp=fopen("w:\\data.dat","rb"))!=NULL) /*加載內容*/
{
fscanf(fp,"%s",test);
fclose(fp);
k=strcmp(temp,test);
if(k!=0) /*判斷內容*/
{
system("title 有新信息-C chat system Client");
printf("%s\n",test);
strcpy(temp,test);
pd=0;
}
if(k==0)
pd++;
}
else return;
}
void exi()
{
FILE *fp;
int k=0;
char tt[255];
if((fp=fopen("c:\\windows\\win.s","wb"))!=NULL)
{fprintf(fp,"%d\r\n",rand()%5000); fclose(fp); return;} /*隨即輸入流*/
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -