資源簡(jiǎn)介
1)服務(wù)器端,分別用線程監(jiān)聽文件和數(shù)據(jù),客戶端一個(gè)連接線程;2)客戶端加入登陸框限制,默認(rèn)用戶名maguiqin,密碼nuaa;3)發(fā)送文件直接用ip框的ip,端口為7000,而數(shù)據(jù)聊天的端口可以設(shè)置4;)加上了Skinsharp皮膚,讓vc6的程序看起來更美觀;5)收發(fā)數(shù)據(jù)采用基本的socket函數(shù),而非CSocket和CAsySocket,發(fā)送文件采用了一下CSocket。有待完善的地方,一是發(fā)文件時(shí)加上進(jìn)度條顯示,二是當(dāng)前只能客戶端往服務(wù)端發(fā)文件,因?yàn)榭梢远鄠€(gè)客戶端。以后完善

代碼片段和文件信息
//?Client.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Client.h“
#include?“ClientDlg.h“
#include?“LoginDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CClientApp
BEGIN_MESSAGE_MAP(CClientApp?CWinApp)
//{{AFX_MSG_MAP(CClientApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CClientApp?construction
CClientApp::CClientApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CClientApp?object
CClientApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CClientApp?initialization
BOOL?CClientApp::InitInstance()
{
if?(!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return?FALSE;
}
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
SkinH_Attach();//加載皮膚
CLoginDlg??logDlg;
if?(logDlg.DoModal()?==?IDCANCEL)
{
exit(EXIT_FAILURE)?;
}
CClientDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????37004??2011-08-18?10:37??xia\Client\Client.aps
?????文件???????1981??2011-08-18?10:42??xia\Client\Client.clw
?????文件???????2297??2011-08-18?10:39??xia\Client\Client.cpp
?????文件???????4359??2011-08-18?10:40??xia\Client\Client.dsp
?????文件???????1324??2011-08-17?20:11??xia\Client\Client.h
?????文件????????246??2011-08-18?10:42??xia\Client\Client.plg
?????文件???????6549??2011-08-18?10:37??xia\Client\Client.rc
?????文件???????9136??2011-08-18?10:39??xia\Client\ClientDlg.cpp
?????文件???????1524??2011-08-18?10:11??xia\Client\ClientDlg.h
?????文件???????2241??2011-08-17?21:47??xia\Client\ClientFileThread.h
?????文件???????1370??2011-08-18?10:41??xia\Client\LoginDlg.cpp
?????文件???????1213??2011-08-18?10:38??xia\Client\LoginDlg.h
?????文件???????3579??2011-08-17?20:11??xia\Client\ReadMe.txt
?????文件???????1078??2011-08-17?20:11??xia\Client\res\Client.ico
?????文件????????398??2011-08-17?20:11??xia\Client\res\Client.rc2
?????文件???????1188??2011-08-18?10:37??xia\Client\resource.h
?????文件??????86528??2009-09-15?10:29??xia\Client\SkinH.dll
?????文件???????8836??2009-09-09?21:04??xia\Client\SkinH.h
?????文件???????6842??2009-09-09?20:13??xia\Client\SkinH.lib
?????文件??????20552??2009-09-09?20:54??xia\Client\skinh.she
?????文件????????208??2011-08-17?20:11??xia\Client\StdAfx.cpp
?????文件???????1154??2011-08-17?20:19??xia\Client\StdAfx.h
?????文件????????440??2011-08-17?22:06??xia\Server\Inc.h
?????文件???????3579??2011-08-17?20:10??xia\Server\ReadMe.txt
?????文件???????1078??2011-08-17?20:10??xia\Server\res\Server.ico
?????文件????????398??2011-08-17?20:10??xia\Server\res\Server.rc2
?????文件????????959??2011-08-17?20:17??xia\Server\resource.h
?????文件??????36264??2011-08-17?22:00??xia\Server\Server.aps
?????文件???????1361??2011-08-18?10:42??xia\Server\Server.clw
?????文件???????2157??2011-08-17?20:10??xia\Server\Server.cpp
............此處省略25個(gè)文件信息
評(píng)論
共有 條評(píng)論