FTP用GetFile()下载文件只能在程序根目录不能指定目录,求助
本帖最后由 oyljerry 于 2012-11-24 15:09:36 编辑
CString strname;
strname=file.GetFileName();
CString strdir;
pFtpConnection->GetCurrentDirectory(strdir);
pFtpConnection->GetFile(selfile,strname); //下载文件到选定的本地位置
pInternetSession->Close(); //关闭废弃的会话
this->ConnectFtp(); //保持持续会话
pFtpConnection->SetCurrentDirectory(strdir);
this->UpdateDir();
AfxMessageBox("下载成功!");
CString selfile;
m_lst.GetText(m_lst.GetCurSel(),selfile);
if (!selfile.IsEmpty())
{
CFileDialog file(false,NULL,selfile,OFN_HIDEREADONLY