资源简介
含有FTP服务器和客户端的源代码程序,本人在vs2010上已经测试过能运行
代码片段和文件信息
/*/////////////////////////////////////////////////////////////////////
FTPclient.cpp (c) GDI 1999
V1.0.0 (10/4/99)
Phil Anderson. philip@gd-ind.com
Download by http://www.codefans.net
Simple FTP client functionality. If you have any problems with it
please tell me about them (or better still e-mail me the fixed
code). Please feel free to use this code however you wish although
if you make changes please put your name in the source & comment what
you did.
Nothing awesome going on here at all (all sockets are used in
synchronous blocking mode) but it does the following
things WinInet doesn‘t seem to:
* Supports loads of different firewalls (I think I don‘t
have access to all types so they haven‘t all been fully
tested yet)
* Allows you to execute any command on the FTP server
* Adds 10K to your app install rather than 1Mb #;-)
Functions return TRUE if everything went OK FALSE if there was an
error. A message describing the outcome (normally the one returned
from the server) will be in m_retmsg on return from the function.
There are a few error msgs in the app‘s string table that you‘ll
need to paste into your app along with this file & FTPclient.h
If you created your app without checking the “Use Windows Sockets“
checkbox in AppWizard you‘ll need to add the following bit of code
to you app‘s InitInstance()
if(!AfxSocketInit())
{
AfxMessageBox(“Could not initialize Windows Sockets!“);
return FALSE;
}
To use:
1/ Create an object of CFTPclient.
2/ Use LogOnToServer() to connect to the server. Any arguments
not used (e.g. if you‘re not using a firewall) pass an empty
string or zero for numeric args. You must pass a server port
number use the FTP default of 21 if you don‘t know what it is.
3/ Use MoveFile() to upload/download a file 1st arg is local file
path 2nd arg is remote file path 3rd arg is TRUE for a PASV
connection (required by some firewalls) FALSE otherwise 4th arg
is TRUE to upload FALSE to download file. MoveFile only works in
synchronous mode (ie the function will not return ‘till the transfer
is finished). File transfers are always of type BINARY.
4/ You can use FTPcommand() to execute FTP commands (eg
FTPcommand(“CWD /home/mydir“) to change directory on the server)
note that this function will return FALSE unless the server response
is a 200 series code. This should work fine for most FTP commands
otherwise you can use WriteStr() and ReadStr() to send commands &
interpret the response yourself. Use LogOffServer() to disconnect
when done.
/////////////////////////////////////////////////////////////////////*/
#include “stdafx.h“
#include “FTPSOCKET.h“
#include “FTPClass.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
/////////////////////////////////////////////////////////////
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13665 2010-05-24 10:17 softhy.net\FTP客户端\FTPClass.cpp
文件 1279 2002-08-07 00:48 softhy.net\FTP客户端\FTPClass.h
文件 22672 2002-11-20 11:51 softhy.net\FTP客户端\FTPSOCKET.APS
文件 1898 2002-11-20 11:51 softhy.net\FTP客户端\FTPSOCKET.clw
文件 2235 2010-05-24 10:17 softhy.net\FTP客户端\FTPSOCKET.cpp
文件 4469 2002-08-07 00:59 softhy.net\FTP客户端\FTPSOCKET.dsp
文件 543 2002-08-06 13:24 softhy.net\FTP客户端\FTPSOCKET.dsw
文件 1357 2002-08-06 13:24 softhy.net\FTP客户端\FTPSOCKET.h
文件 6991 2002-08-08 20:58 softhy.net\FTP客户端\FTPSOCKET.rc
文件 18221 2010-05-24 10:18 softhy.net\FTP客户端\FTPSOCKETDlg.cpp
文件 3565 2002-08-08 21:23 softhy.net\FTP客户端\FTPSOCKETDlg.h
文件 1650 2010-05-24 10:17 softhy.net\FTP客户端\ListItem.cpp
文件 691 2002-03-19 16:53 softhy.net\FTP客户端\ListItem.h
文件 3633 2002-08-06 13:24 softhy.net\FTP客户端\ReadMe.txt
文件 1078 2002-08-06 13:24 softhy.net\FTP客户端\res\FTPSOCKET.ico
文件 401 2002-08-06 13:24 softhy.net\FTP客户端\res\FTPSOCKET.rc2
文件 1462 2002-08-08 20:58 softhy.net\FTP客户端\Resource.h
文件 211 2002-08-06 13:24 softhy.net\FTP客户端\StdAfx.cpp
文件 1108 2002-08-06 19:04 softhy.net\FTP客户端\StdAfx.h
文件 28636 2010-05-24 10:17 softhy.net\FTP服务器\Mini FtpServer.cpp
文件 4667 2002-06-15 14:06 softhy.net\FTP服务器\Mini FtpServer.dsp
文件 553 2002-06-15 17:27 softhy.net\FTP服务器\Mini FtpServer.dsw
文件 1256 2002-06-10 15:52 softhy.net\FTP服务器\ReadMe.txt
文件 301 2002-06-10 15:52 softhy.net\FTP服务器\StdAfx.cpp
文件 730 2002-06-10 15:54 softhy.net\FTP服务器\StdAfx.h
文件 83 2002-06-17 17:25 softhy.net\FTP服务器\说明.txt
目录 0 2010-05-21 09:24 softhy.net\FTP客户端\res
目录 0 2010-05-24 10:16 softhy.net\FTP客户端
目录 0 2010-05-24 10:17 softhy.net\FTP服务器
目录 0 2010-05-24 10:10 softhy.net
............此处省略4个文件信息
- 上一篇:QT+OpenCV+USB摄像头
- 下一篇:linux0.11内核源码
相关资源
- ftpscan扫描工具
- VC FTP文件上传程序.rar
- 绿色版FTP quick easy ftp server
- Linux FTP源代码
- MFTP文件传输
- FTP客户端设计与实现
- FTP课程设计.rar
- STM32+w5500+FTP client
- linux下的简单文件服务器和客户端程序
- 基于linux系统的ftp服务器
- FTP协议父子连接
- qt ftp上传
- 8UFTP,好用的FTP工具
- PCMan-FTP+溢出脚本
- vc实现的ftp客户端断点续传
- linux下的tftp server端的源码
- FTP客户端C源码(Linux版)
- 8UFTP 8UFTP
- vsftpd-2.3.4-5.1.3.x86_64.rpm
- tftp server —一个简易的 tftp 服务器
- 支持计划任务和通配符指定文件名的
- serv-u ftp serverv6.3.0.0 汉化破解版百度网
- ftpserver 绿色版
- vsftpd-3.0.2.tar.gz
- 文件夹目录树列表小工具!实用
- QT4实现的给予QFTP类的FTP客户端程序
- FTP作业代码参考
- 基于Linux的C源代码——一个简单的从
- 计算机网络课程设计:简单FTP客户端
- tc8 x64 openssl库文件补丁
评论
共有 条评论