大學(xué)畢業(yè)論文--即時聊天系統(tǒng)qq項目研發(fā)與實現(xiàn)_第1頁
大學(xué)畢業(yè)論文--即時聊天系統(tǒng)qq項目研發(fā)與實現(xiàn)_第2頁
大學(xué)畢業(yè)論文--即時聊天系統(tǒng)qq項目研發(fā)與實現(xiàn)_第3頁
大學(xué)畢業(yè)論文--即時聊天系統(tǒng)qq項目研發(fā)與實現(xiàn)_第4頁
大學(xué)畢業(yè)論文--即時聊天系統(tǒng)qq項目研發(fā)與實現(xiàn)_第5頁
已閱讀5頁,還剩42頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

課題名稱即時聊天系統(tǒng)QQ項目研發(fā)與實現(xiàn)--頁共28頁jp2_jbl4.setText("<html><Ahref='/cn/services/safe_service/my_prot'>申請密碼保護</A></html>");}publicvoidmouseExited(MouseEvente){jp2_jbl4.setText("申請密碼保護");}publicvoidmouseClicked(MouseEvente){try{//定義網(wǎng)址的內(nèi)容uri2 = newURI("/cn/services/safe_service/my_prot");}catch(URISyntaxExceptione1) {//TODOAuto-generatedcatchblocke1.printStackTrace();}try{//瀏覽uri2網(wǎng)址的網(wǎng)頁desktop.browse(uri2);}catch(IOExceptione1){//TODOAuto-generatedcatchblock//e1.printStackTrace();}}});//申請密碼保護

jp2_jbl3.setCursor(newCursor(Cursor.HAND_CURSOR));//設(shè)置鼠標(biāo)外觀//設(shè)置鼠標(biāo)事件監(jiān)聽jp2_jbl3.addMouseListener(newMouseAdapter(){

publicvoidmouseEntered(MouseEvente){jp2_jbl3.setText("<html><Ahref='/cn/findpsw/findpsw_index?reLogin=true&ADUIN=0&ADSESSION=0&ADTAG=CLIENT.QQ.1881_LoginWndow.0'>忘記密碼</A></html>");}publicvoidmouseExited(MouseEvente){jp2_jbl3.setText("忘記密碼");}publicvoidmouseClicked(MouseEvente){try{//定義網(wǎng)址的內(nèi)容uri3 = newURI("/cn/findpsw/findpsw_index?reLogin=true&ADUIN=0&ADSESSION=0&ADTAG=CLIENT.QQ.1881_LoginWndow.0")desktop.browse(uri3);block}catchblock}catch(URISyntaxExceptione1) {//TODOAuto-generatedcatche1.printStackTrace();}try{//瀏覽uri3網(wǎng)址的網(wǎng)頁}catch(lOExceptione1) {//TODOAuto-generatedcatchblock//e1.printStackTrace();}}});//把控件按照順序加到j(luò)p2jp2.add(jp2_jbl1);jp2.add(jp2_jtf);jp2.add(jp2_jbl5);jp2.add(jp2_jbl2);jp2.add(jp2_jpf);jp2.add(jp2_jbl3);jp2.add(jp2_jcb1);jp2.add(jp2_jcb2);jp2.add(jp2_jbl4);//處理南部jp1=newJPanel(newFlowLayout());jp1_jb1=newJButton(newImageIcon("image/登錄.gif"));//響應(yīng)用戶點擊登錄jp1_jb1.addActionListener(this);jp1_jb2=newJButton(newImageIcon("image/注冊?gif"));jp1_jb2.addActionListener(this);//把兩個按鈕放到j(luò)p1jp1.add(jp1_jb1);jp1.add(jp1_jb2);this.add(jbl1,"North");this.add(jp2,"Center");//把jpl放在南面this.add(jpl,"South");this.setSize(350,265);this.setResizable(false);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);Dimension screenSize =Toolkit.getDefaultToolkit().getScreenSize();//獲取當(dāng)前屏幕大小DimensionframeSize=this.getPreferredSize();//獲取當(dāng)前窗口大小this.setLocation((screenSize.width -frameSize.width)/2, (screenSize.height -frameSize.height)/2);//保持窗口彈出位置居中this.setIconlmage((new ImageIcon("image/頭像.GIF").getImage()));this.setTitle("即時聊天系統(tǒng)QQ用戶登錄");this.setVisible(true);}@OverridepublicvoidactionPerformed(ActionEvente){//TODOAuto-generatedmethodstubif(e.getSource()==jp1_jb1){QqClientUserqqClientUser=newQqClientUser();Useru=newUser();u.setQum(jp2_jtf.getText().trim());u.setOperation("1");

u.setPassword(newString(jp2_jpf.getPassword()));if(qqClientUser,checkUser(u)){try{//把創(chuàng)建好友列表的語句提前qqList=newQqFriendListqqList=newQqFriendList(u.getQum());ManageQqFriendList.addQqFriendList(u.getQum(),qqList);//發(fā)送一個要求返回在線好友的請求的包ObjectOutputStreamoos=newObjectOutputStreamoos=newObjectOutputStream(ManageCIientConServerThread.getClientConServerThread(u.getQum()).getS().getOutputStream());//做一個MessageMessagemFnewMessage();m.setMessType(MessageType.message_get_onLineFriend);//指明我要的是這個qq號的好友情況m.setSender(u.getQum());oos.writeObject(m);}catch(Exceptione1) {//TODO:handleexceptione1.printStackTrace();//同時關(guān)閉掉登陸界面this.dispose();}else{JOptionPane.showMessageDialog(this,"用戶名或密碼錯誤,請重新登錄!","Jasxu提醒你...",JOptionPane.WARNING_MESSAGE);}}elseif(e.getSource()==jp1_jb2){newRegister();}}}附錄B服務(wù)器端工程程序代碼:(1)QQ服務(wù)器端用戶操作數(shù)據(jù)庫代碼(QqServerUser.java)publicclassQqServerUser{publicbooleanSerInsertFriend(String[]paras)//增力卩好友{booleanb=true;SqlHelpermysql=newSqlHelper();Stringsql="insertintofriend(myqno,friendqno)values(?,?)";if(!mysql.SqlUpdate(sql,paras)){//提示b=false;}returnb;publicbooleanSerinsertpersonalinfo(String[]paras)//注冊用戶{booleanb=true;SqlHelpermysql=newSqlHelper();String sql="insert intopersonalinfo(qnum,petname,password,sex,status)values(?, 否')";if(!mysql.SqlUpdate(sql,paras)){//提示b=false;}returnb;}publicString[]showFriend(String[]paras)//查詢某個賬號的所有的好友{SqlHelpermysql=newSqlHelper();Stringsql="selectfriendqnofromfriendwheremyqno=?";returnmysql.FriendQuery(sql,paras);}publicbooleanSerDelFriend(String[]paras)//刪除某個用戶的好友{booleanb=true;SqlHeIpermysql=newSqlHeIper();StringsqI="deletefromfriendwheremyqno=?andfriendqno=?";if(!mysql.SqlUpdate(sql,paras)){//提示b=false;}returnb;}publicbooleanCheckUser(Use

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論