为什么不仔细看看MSDN中的说明:
GetFile is a high-level routine that handles all of the overhead associated with reading a file from an FTP server and storing it locally. Applications that only retrieve file data, or that require close control over the file transfer, should use OpenFile and CInternetFile::Read instead.
GetFile is a high-level routine that handles all of the overhead associated with reading a file from an FTP server and storing it locally. Applications that only retrieve file data, or that require close control over the file transfer, should use OpenFile and CInternetFile::Read instead.
解决方案 »
- 使用CListCtrl和CImageList实现缩略图,在某个缩略图前插入图像的问题
- 求助一个vc6.0,非常荒谬的string table输入繁体中文文字问题
- 一个BoxList里面有几个菜单,如下图,如何判断某一个菜单被鼠标选中,以及鼠标正处于某个菜单项区域内?
- 请教一个LuaBind和MFC一起使用时遇到的问题
- 为什么我在网上下的一个源代码,不允许用DEBUG,只能用RELEASE
- 各位老大:谁有netbios协议的例子程序.发一个给小弟,急用.
- 急:请问下面这个链接错误怎样解决?
- 如何在程序中实现对Windows系统下控制面板中关于打印机的属性的控制,比如,我想在程序中修改打印机的走向(纵向、横向)
- GetFileVersionInfoSize函数如何用?
- 启动后如何直接隐藏到任务栏?
- ADO 中 access的demo字段的读写
- 某月的第一天是星期几。
现在的现象就是GetFile(下载文件)后不能删除,报告:文件已经打开,
而pufile(上传文件)成功.
(好像,只要再服务器方打开文件的操作都关闭不了,也出现同样的问题)
BSTR CFTPCtrl::GetFileString()
{
CString strResult;
// TODO: Add your dispatch handler code here
CInternetFile *f=NULL;
char *buf=new char[65536];
unsigned int i;
if(pFTPcon->SetCurrentDirectory(m_remoteDirectory)==TRUE)
{
if(f==NULL)
{
f=pFTPcon->OpenFile(m_remoteFile,GENERIC_READ,FTP_TRANSFER_TYPE_ASCII,1);
i=f->Read(buf,65536);
f->Close();
}
buf[i]='\0';
strResult=buf;
}
else
{
strResult="";
}
delete buf;
return strResult.AllocSysString();
}谢谢,再给予赐教!
如果Close有问题,你看一下执行Close后抛出的错误信息。
上面的程序的却能够返回所有类容,但是就出现服务器单的该文件就一直打开,关闭FTP服务也不行,只有重启动.
我想是否NT服务器设置有问题?
谢谢,再给予赐教!
我现在只好在ftp命令方面想办法了.