怎么在Win95下面实现FTP,用CInternetSession和CFtpConnection不能运行。请高手指教!!急!!!

解决方案 »

  1.   

    我用了CInternetSession和CFtpConnection做了一个简单的FTP下载程序,但在运行的时候,出现“与应用程序连接的设备不能正常运行”,“应用程序出错!”,但在win98和win2k下运行正常,在win95下重新编译后还是不行,不知何故
      

  2.   

    代码如下:
    void CTestFTPDlg::OnButton1() 
    {

    pSession=new CInternetSession(AfxGetAppName(),1,PRE_CONFIG_INTERNET_ACCESS);
    pConnect=pSession->GetFtpConnection("21.196.68.242","fxj","fxj1zgp");
    if (pConnect!=NULL)
    {
    GetFileFromServer();
    }
    else
    {
    delete pConnect;
    delete pSession;
    AfxMessageBox("连接失败!");
    return;
    }
    pConnect->Close ();
    delete pConnect;
    delete pSession;
    }void CTestFTPDlg::GetFileFromServer()
    {
    if (pConnect->GetFile("pjtemp1.dat","c:\\pjtemp1.dat",FALSE))
    AfxMessageBox("下载成功!");}