區域網聊天室系SQL+VC++

才智咖 人氣:1.69W
畢業論文

目   錄
前言 1
1  系統開發環境和主要技術簡介 2
1.1 Visual C++概述 2
1.1.1  Visual C++的簡介 2
1.1.2  Visual C++的發展過程 2
1.1.3  Visual C++的特點 3
1.1.4  Visual C++6.0的主要特性 3
1.1.5  MFC和Visual C++ 3
1.2  Microsoft SQL Server 2000概述 4
1.2.1  Microsoft SQL Server 2000的發展 4
1.2.2  Microsoft SQL Server 2000的主要功能 4
1.2.3  Microsoft SQL Server 2000的的組成 5
1.3  開放資料庫系統互連ODBC 6
1.3.1  使用ODBC連線 6
1.3.2  ODBC介面的工作原理 6
1.4  微軟基礎類套接字MFC Socket程式設計 8
1.4.1  MFC Socket程式設計機制 8
1.4.2  CSocket類程式設計模型 8
1.5  MFC 的ODBC程式設計 10
1.5.1  MFC的ODBC類 10
1.5.2  CRecordset類 10
2  系統總體設計 12
2.1  需求分析 12
2.1.1  開發背景 12
2.1.2  功能概述 12
2.1.3  執行環境 13
2.1.4  系統總體方案設計 14
2.1.5  資料流圖(DFD) 14
2.2  概要設計 16
2.2.1  結構化設計方法 16
2.2.2  SC圖 16
2.2.3  資料庫設計 19
3  系統詳細設計 21
3.1  伺服器詳細設計 21
3.1.1  伺服器介面設計 21
3.1.2  設定伺服器埠 21
3.1.3  啟動伺服器 23
3.1.4  向客戶端傳送資訊 24
3.1.5  關閉伺服器 26
3.2  客戶端詳細設計 27
3.2.1  客戶端介面設計 27
3.2.2  請求服務 27
3.2.3  使用者註冊 28
3.2.4  使用者登入 31
3.2.5  更改個人資訊 32
3.2.6  顯示線上好友資訊 33
3.2.7  選擇聊天物件 35
3.2.8  向好友傳送訊息 36
3.2.9  關閉客戶端 37
結束語 38
參考文獻 39
致謝 40

區域網聊天室系SQL+VC++

 
區域網聊天室系統


摘   要: 本專案採用軟體工程的方法,綜合運用資料庫技術、程式設計技術、網路技術,以Visual C++ 6.0作為系統前臺應用程式開發工具,Microsoft SQL Server 2000作為後臺DBMS(資料庫管理系統),通過Microsoft 作業系統自帶的ODBC管理工具使兩者進行連線從而進行軟體開發。此區域網聊天工具採用客戶端/伺服器(C/S)模式和TCP連線。它有兩個程式組成:伺服器和客戶端,首先需要登入伺服器,需要指定伺服器地址和埠號,同時註冊1個網名,與伺服器建立連線,如果所取網名已經被其他已經登入的客戶端使用,伺服器會告訴客戶端 ,要求重新登入。登入後,客戶端可以在自己的介面上看到其他線上的客戶端,並可以互相聊天,可以和指定的1個客戶端說話,也可以跟所有人說話。伺服器模組主要用來維護網路上所有使用者的資訊,包括使用者名稱、密碼、好友、好友IP等資訊;聊天客戶端模組主要包括使用者註冊、使用者登入、好友列表、傳送資訊、接收資訊等。是1套適用於Internet網路使用的`網路聊天工具,其操作簡單,靈活性好,執行也比較穩定。

關鍵詞:網路;聊天工具;客戶端/伺服器; 傳輸控制協議。
 
Local Area Chat Room System


Abstract: The program project adopts the method of the software project , use technology of the database, program designing technique and the network technology, use Visual C++6.0 to develop the front side of application , Microsoft SQL Server  2000 is used as the back supporter DBMS( the database management system ), connect the front and the back of the software by ODBC which is embedded in Microsoft OS to develop the local area network chat tool adopts client/server mechanism(C/S) and is composed of two components:the server and the client,first of all,we should login the server,and also should set the server address and port,we must regedit a net name at the same time,so we can connect the the net name is used by another logined client,then the server will inform the client that it should login the client logins successfully,it can see the others at its interface,then it can chat with each other(one or all) server model is mainly used to prootect all users ’ information ,incuuding user’s name,password,friends,the IP address and so on;The client model includes user regediting,user logining,the list of friends,sending message,receiving message and so on. This network chat tool can be used in internet environment ,it can be operated simply, its flexibility is fine and can run steadily.

Keywords:network;chat tool;client/server;TCP.

前 言
隨著網路的普及化,網路作為人們相互間溝通與交流聯絡的現代化工具日益重要,可以說現在人們的生活已經離不開網路。在現實生活中人們可以通過多種手段與家人親戚朋友交流通訊,像電話,電子郵件等等。但這些手段都有些缺點,要麼費用太高,要麼實時性不強,要麼1次只能和1位好友進行交流。於是這就需要1種便宜,快速,能同時與多個好友進行通訊的網路工具的出現,而網路聊天工具就滿足了這些需求,填補了這個空白。
隨著網路技術和資料庫管理系統的發展,C/S體系結構在軟體的開發中越來越流行。因為這種結構的應用軟體可以充分發揮網路的作用和資料庫系統的優勢,以滿足人們各種應用的需求。
同時,Microsoft公司的Visual C++程式設計開發環境,已經成為各國程式設計師開發系統程式和應用程式的首選開發工具。這是由於它有功能強大,支援物件導向,模組化,程式碼可以重用及元件共享等特點,可以大大提供軟體和系統開發的效率,縮短開發週期及便於系統的維護和升級。
網路的飛速發展使網路應用程式的開發地位顯的越來越重要,而網路應用程式的開發和傳統應用程式的開發在思想和實現上有很大的區別。Microsoft公司的Visual C++程式設計開發環境在進行網路應用程式開發方面有以下幾個特點: