资源简介
课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能 课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能 课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能 课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能

代码片段和文件信息
#include “check.h“
int reg_check(struct message *recievemsg)
{
int fd;
int read_sizewrite_size;
struct message cmpmsg;
if(strlen(recievemsg->name)>10 || strlen(recievemsg->msg)>20 )
{
return 1;
}
if(strcmp(recievemsg->name“all“)==0)
{
return -1;
}
if(strcmp(recievemsg->name“reg“)==0)
{
return -1;
}
if(strcmp(recievemsg->name“login“)==0)
{
return -1;
}
if(strcmp(recievemsg->name“trans“)==0)
{
return -1;
}
if((fd=open(“user.txt“O_RDWR|O_CREAT|O_APPEND0666))<0)
{
perror(“open“);
printf(“open\n“);
return -2;
}
do
{
if((read_size=read(fd&cmpmsgsizeof(cmpmsg))) < 0)
{
perror(“read“);
close(fd);
return -2;
}
if(read_size != sizeof(struct message) && read_size !=0)
{
close(fd);
return -2;
}
if(strcmp(recievemsg->namecmpmsg.name)==0)
{
close(fd);
return -1;
}
}while(read_size == sizeof(struct message));
if((write_size=write(fdrecievemsgsizeof(struct message)))<0)
{
perror(“write“);
close(fd);
return -2;
}
while(write_size!=sizeof(struct message))
{
//write_size = 0-writesize;
lseek(fd-write_sizeSEEK_CUR);
write_size=write(fdrecievemsgsizeof(struct message));
}
printf(“write file success\n“);
close(fd);
return 0;
}
int login_check(struct message *recievemsg)
{
int fd;
struct message cmpmsg;
int read_size;
if((fd=open(“user.txt“O_RDONLY))<0)
{
perror(“open“);
return -2;
}
do
{
if((read_size=read(fd&cmpmsgsizeof(struct message)))<0)
{
perror(“read“);
close(fd);
return -2;
}
if(read_size != sizeof(struct message) && read_size!=0)
{
close(fd);
return -2;
}
if((strcmp(recievemsg->namecmpmsg.name)==0)&&(strcmp(recievemsg->msgcmpmsg.msg)==0))
{
close(fd);
return 0;
}
}while(read_size>0);
close(fd);
return -1;
}
/*
void main()
{
struct message sendmsg;
printf(“input name:\n“);
gets(sendmsg.name);
printf(“input mima:\n“);
gets(sendmsg.msg);
printf(“%d\n“reg_check(&sendmsg));
// printf(“%d\n“login_check(&sendmsg));
}
*/
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 40448 2009-09-03 09:59 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\3.Linux下网络聊天室--需求说明书.doc
文件 55296 2009-09-04 14:29 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\4.Linux下网络聊天室--概要设计说明书.doc
文件 4565 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\chatlog.txt
文件 2060 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\check.c
文件 402 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\check.h
文件 9873 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\client.c
文件 10749 2009-09-04 14:04 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\client1.c
文件 14172 2009-09-04 14:22 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\clientb\client2
文件 6428 2009-09-04 14:22 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\clientb\display2
文件 1072 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\display.c
文件 1153 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\li
文件 564 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\li
文件 278 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\makefile
文件 6337 2009-09-04 13:35 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\server.c
文件 6985 2009-09-04 14:15 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\server1.c
目录 0 2009-09-04 14:22 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\clientb
目录 0 2009-09-14 23:19 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能\课程设计 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能
目录 0 2009-09-14 23:18 linux c 聊天程序公聊 私聊 传文件 注册 登入 等功能
----------- --------- ---------- ----- ----
160382 18
- 上一篇:局域网传输文件 聊天工具 飞鸽
- 下一篇:kinect官方技术文档英文
相关资源
- STM32F103RC+ADC+DMA多通道采样LCD显示
- Modbus协议官方文档中、英文全
- pcbtemp电流计算软件
- I2C读写AT24C02 基于STM32F103 cube116540
- Scratch源码
- Microsoft Forms 2.0107770
- 实验三 消息中间件应用开发:Active
- WCE注入工具
- ModelGoon-4.4.1-site.zip
- AsyncTask文件控制暂停和继续,在状态
- Visio大全模具(含Cisco、IBM等常用拓扑
- 信号奇异点Lipschitz指数计算
- 基于STM32RCT6的步进电机驱动程序
- 酒店管理系统基于Qt Creator5)
- 用友NC开发API字典
- Navicat Premium 15汉化包.zip55438
- 登录注册界面.zip48872
- 条码字体barcode128
- Rational Rose Common破解文件
- res10_300x300_ssd_iter_140000.caffemodel与dep
- scratch 第1课 翻跟斗的小猫(入门)
- stm32f407上的两个can发送和接收例程
- Scrach 欢乐狙击手.sb2
- 04741计算机网络原理知识点整理.docx(
- Wolfram Mathematica 矩阵初等变换函数(
- pscad近海风电模型 Fortran语言
- 程序员专用字体YaHei.Consolas.1.11b42517
- scratch3.0 源程序(说相声)
- AutoCAD永久去教育版破解补丁
- 开源1A锂电池充电板TP4056原理图+PCB
评论
共有 条评论