资源简介
1)服务器端,分别用线程监听文件和数据,客户端一个连接线程;2)客户端加入登陆框限制,默认用户名maguiqin,密码nuaa;3)发送文件直接用ip框的ip,端口为7000,而数据聊天的端口可以设置4;)加上了Skinsharp皮肤,让vc6的程序看起来更美观;5)收发数据采用基本的socket函数,而非CSocket和CAsySocket,发送文件采用了一下CSocket。有待完善的地方,一是发文件时加上进度条显示,二是当前只能客户端往服务端发文件,因为可以多个客户端。以后完善
代码片段和文件信息
// 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;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 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个文件信息
相关资源
- 基于mfc的多线程文件传输
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 文件传输和聊天程序(c语言实现)
- 基于CS的TCP文件传输程序设计
- windows网络编程_文件传输
- 多线程串口通讯
- Win32多线程程序设计--详细书签版
- QT实现视音频实时传输qml+C++
- 基于socket文件传输的实现源码[C++]
- Linux多线程服务端编程:使用muduo C+
- VC++实现两台电脑文件传输(源代码)
- 基于TCP协议的文件传输编程
- TCP实现服务器和多客户端通信
- MultiThread(VS2013 MFC多线程-含源码-含个
- C++编写的多线程C/S模式仿QQ软件
- 多线程
- C++ Concurrency in Action 2nd edition235206
- MFC Csocket实现点对点文件传输
- C++多线程网络聊天程序
- MFC中利用多线程实现定时器
- C++实现网络文件传输
- MFC实现多任务多线程软件
- MFC多线程编程三个
- C++实现cs模式下文件传输
- c++ ftp文件传输
- C++ Socket 多线程多机聊天
- C语言写的UDP文件传输
- 基于MFC局域网聊天和文件传送程序
- C语言写的文件传输系统
川公网安备 51152502000135号
评论
共有 条评论