【正文】
he 。 He stood for a moment in thought. 39。 said Aragorn. 39。 39。 said Legolas. 39。 39。 said Gimli. 39。 39。 said Aragorn. 39。 on the front of their iron helms was set an Srune, wrought of some white metal. 39。Here lie many that are not folk of Mordor. Some are from the North, from the Misty Mountains, if I know anything of Orcs and their kinds. And here are others strange to me. Their gear is not after the manner of Orcs at all!39。will take all the arrows that I can find, for my quiver is empty.39。And I,39。They were borne by the hobbits. Doubtless the Orcs despoiled them, but feared to keep the knives, knowing them for what they are: work of Westernesse, wound about with spells for the bane of Mordor. Well, now, if they still live, our friends are weaponless. I will take these things, hoping against hope, to give them back.39。No orctools these!39。 He picked out from the pile of grim weapons two knives, leafbladed, damasked in gold and red。 cried Aragorn. 39。 Quickly they searched the bodies of the Orcs, gathering their swords and cloven helms and shields into a heap. 39。 said Aragorn. 39。 said Gimli. 39。 39。 said Legolas. 39。 39。 said Aragorn. 39。 39。 said Gimli. 39。 39。 said Legolas. 39。 39。 he did not think that they were dead. I sent him to follow Merry and Pippin。 answered Aragorn wearily. 39。 39。 cried Gimli 39。 39。 said Aragorn. 39。 39。s side. 39。Alas!39。s hand. So it was that Legolas and Gimli found him. They came from the western slopes of the hill, silently, creeping through the trees as if they were hunting. Gimli had his axe in hand, and Legolas his long knife: all his arrows were spent. When they came into the glade they halted in amazement。 but where are the Ring and the Bearer? How shall I find them and save the Quest from disaster?39。Thus passes the heir of Denethor, Lord of the Tower of Guard! This is a bitter end. Now the Company is all in ruin. It is I that have failed. Vain was Gandalf39。Alas!39。Which way did they go? Was Frodo there?39。You have conquered. Few have gained such a victory. Be at peace! Minas Tirith shall not fall!39。No!39。Farewell, Aragorn! Go to Minas Tirith and save my people! I have failed.39。They have gone: the Halflings: the Orcs have taken them. I think they are not dead. Orcs bound them.39。 His glance strayed to his fallen enemies。 he said. 39。 his horn cloven in two was at his side. Many Orcs lay slain, piled all about him and at his feet. Aragorn knelt beside him. Boromir opened his eyes and strove to speak. At last slow words came. 39。 and as he turned to the left and ran towards them they retreated, until at last he could hear them no more. Drawing his bright sword and crying _Elendil! Elendil!_ he crashed through the trees. A mile, maybe, from Parth Galen in a little glade not far from the lake he found Boromir. He was sitting with his back to a great tree, as if he was resting. But Aragorn saw that he was pierced with many blackfeathered arrows。參考文獻(xiàn)[1] Douglas E Comer , David L Stevens. Internet Working With TCP/ IP Vol Ⅱ:Design , Implementation and Internal [M] . 張娟,等譯. 北京:電子工業(yè)出版社,1998.[2] 李鵬. 計算機(jī)通信技術(shù)及其程序設(shè)計[M] . 西安:西安電子科技大學(xué)出版社,1998.[3] 黃超. Windows網(wǎng)絡(luò)編程[M] . 北京:人民郵電出版社,2000[4] 劉運強(qiáng),王匯源1Socket 和多線程在視頻傳輸?shù)膽?yīng)用[J ] 山東大學(xué)學(xué)報(工學(xué)版) ,2004 ,34(2) :452501[5] 胡濤1Visual C + + 1NET 編程技術(shù)體驗[M]1 北京:清華大學(xué)出版社,1991[6] 蘇炳秒,黃勁 基于Socket 技術(shù)的煤礦遠(yuǎn)程監(jiān)控系統(tǒng)[J ]工礦自動化,2003 , (1) :372391[7] 袁立民 一種視頻圖像傳輸?shù)亩嗑€程實現(xiàn)方法[J] 電子技術(shù)應(yīng)用,1999 ,25(1) :492501[8] 蔣東興 Windows Sockets 網(wǎng)絡(luò)程序設(shè)計大全[M]北京:清華大學(xué)出版社,19991[9] 王騫,等 一類網(wǎng)絡(luò)控制系統(tǒng)的建模及分析[J ] 控制工程,2004 ,11(6) :52925321r, but fainter now and desperately the horn was blowing. Fierce and shrill rose the yells of the Orcs, and suddenly the horncalls ceased. Aragorn raced down the last slope, but before he could reach the hill39。我的論文的完成,離不開這位老師的指導(dǎo)與關(guān)愛。7 致謝我的作品基于TCP/IP的網(wǎng)絡(luò)聊天工具的設(shè)計與實現(xiàn),達(dá)到了我預(yù)先的效果。本文以Visual C++的MFC(微軟基本類庫)作為基本的開發(fā)基礎(chǔ), 使用Socket 套接字作為開發(fā)的應(yīng)用程序開發(fā)模型, 完成了網(wǎng)絡(luò)在線聊天系統(tǒng)的設(shè)計及實現(xiàn)過程, 通過測試表明該系統(tǒng)可以方便的建立連接, 斷開連接, 實現(xiàn)網(wǎng)絡(luò)在線聊天系統(tǒng)的在線好友查找, 發(fā)送消息和接收消息等功能。一個服務(wù)程序通常在一個眾所周知地地址監(jiān)聽客戶對服務(wù)地請求, 也就是說, 服務(wù)進(jìn)程一直處于休眠狀態(tài), 直到一個客戶對這個服務(wù)地址提出連接請求。一個對稱協(xié)議地例子是Internet中用于終端仿真地Telnet, 而非對稱協(xié)議地例子是Internet 中的。在對稱的協(xié)議中每一方都有可能扮演主從角色。客戶機(jī)/服務(wù)器模型工作時要求有一套為客戶機(jī)和服務(wù)器所共識的慣例來保證服務(wù)能夠被提供( 或被接受) , 這一套慣例包含了一套協(xié)議, 它必須在通信的兩頭都被實現(xiàn)。進(jìn)入20 世紀(jì)90 年代后, 隨著計算機(jī)和網(wǎng)絡(luò)技術(shù)的發(fā)展,很多數(shù)據(jù)處理系統(tǒng)都采用開放系統(tǒng)結(jié)構(gòu)的客戶機(jī)/服務(wù)器(Client/Server)網(wǎng)絡(luò)模型,即客戶機(jī)向服務(wù)器提交請求,服務(wù)器對請求做相應(yīng)的處理兵執(zhí)行被請求的任務(wù),然后將結(jié)構(gòu)返回給客戶機(jī)。因而各種聊天服務(wù)備受用戶青睞, 在這方面的開發(fā)與應(yīng)用也較多[1], 聊天服務(wù)也成為互聯(lián)網(wǎng)提供的重要服務(wù)之一。 *pResult = 0。 (iSel, 6, sStartTick)。 char sStartTick[20]。 strcpy(, (iSel, 5))。 = 0。 = FILEDATA。 } ()。 if(!bOpen) { MessageBox(文件創(chuàng)建或打開失?。≌埓_認(rèn)路徑再重試!)。 CFile file。 if(() != IDOK) return。 CString strFileName = (iSel, 0)。 int iSel = pListViewiItem。 另外, 對于較大的文件, 應(yīng)該分批傳輸,一般每次1至4KB為宜,以保證數(shù)據(jù)傳輸?shù)姆€(wěn)定性, 同時也不至于過多地占用系統(tǒng)資源。Socket 通信在Windows 中以排隊形式由操作系統(tǒng)進(jìn)行處理, 基本方式是請求和應(yīng)答, 而且接收方和發(fā)送方必須相互協(xié)同工作,否則就會造成數(shù)據(jù)丟失。這時信息只顯示在聊天人的客戶端中,而在其他客戶端,并不顯示該信息。 GetDlgItem(IDC_TEXT)SetWindowText(strText)。 pDocSendMsg()。 BYTE i3=GetBValue(pDocclr)。 BYTE i1=GetRValue(pDocclr)。 else pDoc=FALSE。 pDoc=to。 pDoc=ll。 int j=()。 if(strText==) return。 GetDlgItem(IDC_TEXT)GetWindowText(strText)。 ASSERT_VALID(pDoc)。啟動服務(wù)端,顯示服務(wù)端界面:圖6 用戶管理界面打開客戶端,顯示客戶端登陸界面:從名稱的下拉列表框中選擇登錄的用戶,單擊確定,進(jìn)入該用戶聊天的界面,同時服務(wù)端也會顯示出該用戶的進(jìn)入信息:在聊天對象中,選擇所有人,在聊天信息中,輸入信息,單擊發(fā)送信息。派生類CListeningSocket的回調(diào)函數(shù)OnAccpet()與客戶端建立套接字層次的連接。 本實驗采用VS 2003 為平臺利用VC++開發(fā)語言進(jìn)行程序編寫。消息顯示框發(fā)送消息傳輸文件(下拉框)選擇聊天對象(復(fù)選框)二人私聊圖 4功能及模塊實現(xiàn)窗口圖 4中聊天對象下拉框中,包括所有人選項和登陸某某用戶名的下拉框選項,如下圖5,所有人張三李四…圖5 選擇用戶下拉框點擊文件傳輸按鈕后,在文件傳輸對話框中會顯示相應(yīng)的傳輸文件,只要雙擊你所需要的文件,選擇相應(yīng)的存儲路徑后即可存儲文件。更加重要的是CSocket 和Carchive 類提供了對于同步操作Carchive 對象十分重要的阻塞功能, 且CSocket 通過與CSocketFile 和Carchive 一起使用來管理對象數(shù)據(jù)的發(fā)送和接收, 使發(fā)送數(shù)據(jù)和操作變得簡單明了 系統(tǒng)功能設(shè)計 客戶端功能程序設(shè)計首先介紹客戶端的用戶登錄窗體,輸入用戶名和服務(wù)器ip地址后進(jìn)入聊天室。其次,CSocket 類是CAsyncSocket 類的派生類, 它提供了對通過Carchive 對象使用套接字工作的更高級抽象。 MFC Windows Socket 類包括CAsyncSocket 和CSocket 類。服務(wù)器端連接過程簡化為:①設(shè)置連接所用的端口②開始監(jiān)聽此端口③接到請求后建立連接④可以發(fā)送和接收數(shù)據(jù)⑤不用了就關(guān)閉Socket連接。采用服務(wù)器與客戶端模式