建议用openurl得到url,
如hHttpFile=(CInternetFile*)session.OpenURL(Url)

解决方案 »

  1.   

    看错那,不好意思,我在匿名ftp上 try可行!!!
      

  2.   

    1.将pConnect = sess.GetFtpConnection(_T("ftp://localhost/sy/"));
    改为pConnect = sess.GetFtpConnection(_T("ftp://localhost/sy/"),_T("username"),_T("password"));
    2.将delete pConnect;去掉,因为你并没有new
    3.注意pConnect->PutFile("text1.txt","c:\\ftpwenjian.txt");参数的含义,源和目的分清BOOL PutFile( LPCTSTR pstrLocalFile, LPCTSTR pstrRemoteFile, DWORD dwFlags = FTP_TRANSFER_TYPE_BINARY, DWORD dwContext = 1 );
    4.upupzaiup,gzgzzaigz,give me scores.
      

  3.   

    下面这部分是绝对没问题的,就不try了,呵呵,give me scores,please
    #include <afxinet.h>
    main()
    {
    CInternetSession sess("MyPrgm/1.0");
    CFtpConnection* pConnect=NULL;
    {
    pConnect=sess.GetFtpConnection("10.7.1.109","user","pass");
    }
    pConnect->PutFile("d:\\mft.txt","hedi_prgm:[trn]mft.txt");
    if(pConnect!=NULL)
    {
    pConnect->Close();
    }}