理工大学学士学位论文I摘要随着互联网技术的飞速发展基于网络的即时通信软件给我们带来诸多便利,也成为当今网络应用的主流。聊天工具作为当今使用最为广泛的即时通信工具之一,可以方便人们随时随地进行在线交流。本文就是模拟QQ聊天软件,开发一个包括文字聊天、文件传输等功能的聊天软件。本文首先针对网络即时通信系统的功能需求进行了分析,然后按照系统的功能需求对系统的体系结构进行了设计,并针对各个功能模块的执行流程进行了详细的分析。系统采用功能强大的VC++作为开发平台,以C/S模式作为开发模式,客户端实现了用户注册、用户登录、用户信息查询、个人信息修改、查看在线人员、消息传送以及文件传输等功能,服务器端实现了服务启动停止、用户信息管理和数据消息处理等功能。在系统实现过程中,将客户端与服务器端的功能分别实现,着重研究如何运用Socket编程技术和TCP/IP协议来实现通信交流,并采用多线程实现不同的并行任务。本系统最终能够应用于网络环境,应用数据库对通信用户及通信消息等进行管理。关键词:网络即时通信系统;VC++;C/S模式;Socket编程沈阳理工大学学士学位论文IIAbstractWiththerapiddevelopmentofInternettechnology,theChatSoftwareoftheinstantmessengerbasedonnetworkbringsmanyconveniencestous,alsobecomesthefocusofnetworkapplicationinpresent.Chatisoneofthemostwidespreadinstantmessengers,mayfacilitatethepeopletocarryontheonlineinformationexchangeatanytimeandanywhere.Thisprojectdevelopschatsoftware,whichincludesthewritingandfiletransferandsoon.Firstly,analysisoffunctionalrequirementsforinstantnetworkmessagingsystem,andthenfollowthesystem'sfunctionalrequirements,systemarchitecturedesign,andcarriedoutadetailedanalysisoftheimplementationprocessforeachfunctionalmodule.SystemusesapowerfulVC++asadevelopmentplatform,C/Smodelasadevelopmentmodel,theclientachievetheuserregistration,userlogin,userinformationtoview,personalinformationchanges,messagingandfiletransferandotherfunctions,theserversidetoachievetheservicestartandstopthelinetoviewtheuserinformationmanagementanddatamessagingfunctions.Intheprocessofsystemimplementation,theclientandserversidefunctionrespectively,thispaperstudieshowtousetheSocketprogrammingtechnologyandTCP/IPprotocoltorealizecommunication,usingmulti-threadedimplementationdifferentparalleltasks.Thissystemeventuallyisusedinanetworkenvironment,theapplicationdatabasetomanagecommunicationsusersandcommunicationmessages.Keywords:Instantnetworkmessagingsystem;VC++;C/Smode;SocketProgramming沈阳理工大学学士学位论文III目录1绪论...................................................................................................................................11.1课题的背景及意义.......................................................................................................11.2课题的国内外研究现状...............................................................................................11.3课题研究的主要内容...................................................................................................21.4论文的组织结构...........................................................................................................22网络即时通信软件开发的相关技术.................................................................................42.1OSI七层网络模型........................................................................................................42.2网络传输协议...............................................................................................................42.2.1TCP/IP协议...........................................................................................................42.2.2TCP协议和UDP协议..........................................................................................52.3C/S编程模型................................................................................................................62.4WindowsSockets简介.................................................................................................72.5MFCWindowsSocket类.............................................................................................82.5.1CAsyncSocket异步类...........................................................................................82.5.2CSocket类..............................................................................................................82.6MFC多线程编程技术..................................................................................................92.7Access数据库.............................................................................................................103网络即时通信软件开发的系统需求分析........................................................................123.1系统实现目标.............................................................................................................123.2功能性需求描述.........................................................................................................124网络即时通信软件开发的系统总体设计........................................................................154.1系统体系结构设计.....................................................................................................154.2系统功能模块介绍.....................................................................................................16沈阳理工大学学士学位论文IV4.3功能模块调用关系.....................................................................................................175网络即时通信软件开发的系统详细设计........................................................................185.1客户端的详细设计.....................................................................................................185.2服务器的详细设计.....................................................................................................235.3数据库设计....................................................................