同样的问题,同样的说明,sigh.. PutFile is a high-level routine that handles all of the operations associated with storing a file on an FTP server. Applications that only send data, or that require closer control over the file transfer, should use OpenFile and CInternetFile::Write.
但是getfile(下载文件)后文件(自认为处于打开状态)再删除将无法删除,
服务器方手工删除也报告文件正在使用,不能删除,只有重启动.
问:如和在getfile后关闭文件.万分感激!!!
.我写的是一个FTP-OCX控件:代码如下:
pFTPcon=eSession.GetFtpConnection(m_remoteAddress,m_userName,m_password);BOOL CFTPCtrl::GetFile() file://下载文件
{
pFTPcon->SetCurrentDirectory(m_remoteDirectory);
CString strTemp;
CString strAdd="\\";
strTemp=m_localDirectory;
if(strTemp.GetLength()==3)
{
strTemp.Insert(strTemp.GetLength(),m_localFile);
}
else
{
strTemp.Insert(strTemp.GetLength(),strAdd);
strTemp.Insert(strTemp.GetLength(),m_localFile);
}
pFTPcon->GetFile(m_remoteFile,strTemp,FALSE);
return TRUE;
}BOOL CFTPCtrl::PutFile() file://上传文件
{
// TODO: Add your dispatch handler code here
pFTPcon->SetCurrentDirectory(m_remoteDirectory);
CString strTemp;CString strAdd;strAdd="\\";
strTemp=m_localDirectory;
if(strTemp.GetLength()==3)
{
strTemp.Insert(strTemp.GetLength(),m_localFile);
}
else
{
strTemp.Insert(strTemp.GetLength(),strAdd);
strTemp.Insert(strTemp.GetLength(),m_localFile);
}
if(m_binary==TRUE)
{return pFTPcon->PutFile(strTemp,m_remoteFile);}
else
{return pFTPcon->PutFile(strTemp,m_remoteFile,FTP_TRANSFER_TYPE_ASCII);}
}
谢谢再赐教!!!
先get;
再put;
再delete;
不要笑我。
PutFile is a high-level routine that handles all of the operations associated with storing a file on an FTP server. Applications that only send data, or that require closer control over the file transfer, should use OpenFile and CInternetFile::Write.