到vckbase.com或者vchelp.net找些例子或者文档看看
解决方案 »
- 恭喜群里阿少哥喜得千金
- 【求助】CTreeCtrl的一个问题
- active skin有人用过么?有没有办法注册?
- 各位VC高手,进来刺激一下你的神经吧,查MSDN未果.高手进来看看.
- 需要一份使用CTreeCtrl的code
- CEdit怎样实现多行显示啊?
- 我想用ADO以快照形式打开数据库,要使用什么参数啊?
- 真奇怪!奇怪之极!
- 怎么创建一个子窗口?以及它的响应消息的系统?
- 谁有http://www.programsalon.com/download.asp?type_id=64的账号?
- 我写过一个把本地文件上传和下载到Ftp服务器的函数(公开源代码),我现在想要一个把本地目录上传下载到FTP服务器的函数的VC源代码
- 关于使用CSocket编写FTP的问题。
FtpDeleteFile
FtpFindFirstFile
FtpGetCurrentDirectory
FtpGetFile
FtpOpenFile
FtpPutFile
FtpRemoveFile
FtpSetCurrentDirectory
//首先在服务器端的FTP主目录下放一个Config.txt的文本文件,
CInternetSession session;
//连接FTP Server
CFtpConnection *TempFtp=session.GetFtpConnection("dbs","Administrator","123321");
//下载文件
TempFtp->GetFile("Config.txt","e:\\ee.txt",TRUE,FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_ASCII,1);
//处理文件
FILE *fp;
fp=fopen("e:\\ee.txt","a+");
fprintf(fp,"\nAdd Line\n");
fclose(fp);
//上传文件
TempFtp->PutFile("e:\\ee.txt","Config.txt",FTP_TRANSFER_TYPE_ASCII,1);
//关闭连接
TempFtp->Close();
session.Close();
//OK
CFtpFileFind
#include <afx.h>
#include <afxwin.h>
#include <afxinet.h>
#include <stdio.h>// compile for release with
// cl /MT /GX
// or for debug with
// cl /MTd /GXCWinApp theApp;void main()
{
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// catastropic error! MFC can't initialize
return;
} // create a session object to initialize WININET library
// Default parameters mean the access method in the registry
// (that is, set by the "Internet" icon in the Control Panel)
// will be used. CInternetSession sess(_T("MyProgram/1.0")); CFtpConnection* pConnect = NULL; try
{
// Request a connection to ftp.microsoft.com. Default
// parameters mean that we'll try with username = ANONYMOUS
// and password set to the machine name @ domain name
pConnect = sess.GetFtpConnection(_T("ftp.microsoft.com")); // use a file find object to enumerate files
CFtpFileFind finder(pConnect); // start looping
BOOL bWorking = finder.FindFile(_T("*")); while (bWorking)
{
bWorking = finder.FindNextFile();
printf("%s\n", (LPCTSTR) finder.GetFileURL());
}
}
catch (CInternetException* pEx)
{
TCHAR sz[1024];
pEx->GetErrorMessage(sz, 1024);
printf("ERROR! %s\n", sz);
pEx->Delete();
} // if the connection is open, close it
if (pConnect != NULL)
pConnect->Close();
delete pConnect; return;
}VC自带Sample中含有ftptree例程!
ahphone(阿丰) 的类好象不存在!
我最近比较忙,别的朋友的办法还没有试,分我肯定会给的,再次感谢!