请给我一个从一FTP服务器上定时收取一文件的程序?
谢谢!

解决方案 »

  1.   

    请问下面这段程序应该怎样改才能实现重FTP服务器下载文件?
    是否要打开FTP功能才能下载?
    有没有某些网站的FTP用户名和密码?给我一个试程序!谢谢!
    void CFTPReceive::OnButtonReceive() 
    {
    // TODO: Add your control notification handler code here// *** My Code is Start!
    //(2003.12.30)
    CFTPReceive dlg;
    CString host;
    CString user;
    CString password;
    CString filename;
    short  port; host = dlg.m_Host;
    user = dlg.m_User;
    password = dlg.m_Password;
    filename = dlg.m_ReceiveFile;
    // filename = "D:\SXYST\ScQtYstQdN.ini";
    port = dlg.m_sPort; TRACE(":%s:%s:%s:%s\n", host, user, password, filename); //生成CInternetSession变量
    CInternetSession ses; //打开FTP连接
    CFtpConnection* pFTP=ses.GetFtpConnection("61.139.77.15", user, password); if (pFTP) 
    {
    if (!pFTP->GetFile(filename,filename))
    {
    MessageBox("接收文件失败??");

    else 
    {
    MessageBox("接收文件成功!");
    }
    pFTP->Close();
    delete pFTP;
    ses.Close();

    else 
    {
    MessageBox("Cannot Connect");
    } //打开文件
    // CInternetFile* pF=pFTP->OpenFile("abc.exe");
    // *** My Code is End!
    }