发信人: hysc(hysc)
整理人: wenbobo(2002-08-05 19:52:37), 站内信件
|
CInternetSession session;
CFtpConnection *ftp;
ftp=session.GetFtpConnection (m_ip,m_user,m_pass);
CString dir;
ftp->GetCurrentDirectoryAsURL (dir);
ftp->SetCurrentDirectory (m_path);
ftp->GetCurrentDirectory (dir);
CString rptfile;
m_file.MakeReverse();
int len=m_file.Find ('\\');
m_file.MakeReverse ();
rptfile=m_file.Right (len);
char unixpath[1024];
strcpy(unixpath,m_path.GetBuffer (m_path.GetLength ()));
CString ftpfile;
if(unixpath[m_path.GetLength ()-1]=='/')
ftpfile=m_path+rptfile;
else
ftpfile=m_path+'/'+rptfile;
ftp->PutFile(m_file.GetBuffer(m_file.GetLength()),ftpfile,FTP_TRANSFER_TYPE_ASCII);
ftp->Close ();
<p> |
|