资源简介
采用socket实现http协议的下载,利用C++封装,这是不可多得的例程
代码片段和文件信息
// Http.cpp : Defines the initialization routines for the DLL.
//
#include “stdafx.h“
#include “Http.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern “C“ BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
/////////////////////////////////////////////////////////////////////////////
// CHttpApp
BEGIN_MESSAGE_MAP(CHttpApp CWinApp)
//{{AFX_MSG_MAP(CHttpApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHttpApp construction
CHttpApp::CHttpApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
///初始化Socket函数库
int err;
WORD wVersion;
WSADATA WSAData;
wVersion=MAKEWORD(20);
err=WSAStartup(wVersion&WSAData);
if(err!=0)
{
AfxMessageBox(“无法装载Socket库.“);
}
if(LOBYTE( WSAData.wVersion ) != 2)
{
AfxMessageBox(“无法找到合适的Socket库.“);
WSACleanup();
}
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CHttpApp object
CHttpApp theApp;
int CHttpApp::ExitInstance()
{
///清除Socket库
WSACleanup();
return CWinApp::ExitInstance();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2004-08-01 09:35 Http
文件 17992 2004-07-31 12:05 Http\Http.aps
文件 349 2004-07-07 13:01 Http\Http.clw
文件 2136 2004-07-07 13:01 Http\Http.cpp
文件 178 2004-07-07 13:01 Http\Http.def
文件 4324 2004-07-31 11:06 Http\Http.dsp
文件 531 2004-07-07 13:01 Http\Http.dsw
文件 1271 2004-07-07 13:01 Http\Http.h
文件 82944 2004-07-30 18:09 Http\Http.ncb
文件 77824 2004-07-30 18:09 Http\Http.opt
文件 242 2004-07-31 12:03 Http\Http.plg
文件 3053 2004-07-07 13:01 Http\Http.rc
文件 1176 2004-07-07 13:01 Http\Http1_1.h
文件 8277 2004-07-31 12:03 Http\HttpSocket.cpp
文件 1848 2004-07-31 12:03 Http\HttpSocket.h
文件 2538 2004-07-07 13:01 Http\ReadMe.txt
目录 0 2004-07-30 18:10 Http\res
文件 396 2004-07-07 13:02 Http\res\Http.rc2
文件 376 2004-07-07 13:01 Http\Resource.h
文件 5000 2004-07-07 13:01 Http\SocketBuffer.cpp
文件 1014 2004-07-07 13:01 Http\SocketBuffer.h
文件 206 2004-07-07 13:01 Http\StdAfx.cpp
文件 1492 2004-07-07 13:01 Http\StdAfx.h
目录 0 2004-08-01 09:37 TestHttp
目录 0 2004-08-01 09:36 TestHttp\Debug
目录 0 2004-07-31 10:21 TestHttp\Debug\Debug
文件 110670 2004-07-31 12:03 TestHttp\Debug\Http.dll
文件 118870 2004-08-01 09:36 TestHttp\Debug\TestHttp.exe
文件 6574 2004-07-31 12:03 TestHttp\Http.lib
文件 1848 2004-07-31 12:03 TestHttp\HttpSocket.h
............此处省略25个文件信息
- 上一篇:RC4在C++中运行的代码
- 下一篇:OpenCV手势识别-手掌特征提取源码
相关资源
- STM32F207通过http更新固件
- C++多线程网络编程Socket
- c语言看发的网络协议 ,源代码
- GD32F103 在线串口Ymodem协议升级IAP
- Modbus协议原文-开必者实用资料
- STM32连接EC20使用内置MQTT协议接入阿里
- C语言嵌入式Modbus协议栈,支持主站和
- olsr协议代码
- C语言封装的HttpClient接口
- socket客户端.c
- socket服务端.c
- socket tcp应用
- socket通讯c++源码(客户端+服务端)
- MFC的异步网络通讯应用程序
- c++开发http服务端+客户端
- MQTT协议
- 各种关于CAsyncSocketCSocket内幕及其用法
- VC++写的SMTP协议发附件超酷啊直接可以
- MFC多人聊天室
- 使用socket套接字发送udp数据包
- CAsyncSocket异步实现服务器与客户端
- 基于TCP协议的C/S传输文件C++)
- 基于socket文件传输的实现源码[C++]
- 使用C++实现HDLC协议
- C语言实现TCP/IP协议通信和UDP协议通信
- DemoHttpMFC.zip
- c语言+UDP+DES加密+socket编程
- 局域网下,手机可以和电脑通过sock
- 计算机网络课程设计之Ping程序含C++原
- 基于c++和winsocket的局域网聊天源代码
川公网安备 51152502000135号
评论
共有 条评论