网络

一、FTP服务
    CInternetSession sess(_T("  "));    CFtpConnection* pConnect = NULL;    CInternetFile* pFile = NULL;    
    pConnect = sess.GetFtpConnection("IP","USER","PSW");
    pConnect->GetCurrentDirectory(strDirName);         pConnect->SetCurrentDirectory(path);
    CFtpFileFind finder(pConnect);    
    if(finder.FindFile(FileName))
    {   pFile = pConnect->OpenFile(FileName);            char* BUFF = new char[500];
        pFile->Read(BUFF,430);            str.Format(_T("%s"), BUFF);
        pFile->Close();    int index = str.Find("RE "); str = str.Right(str.GetLength()-index-1); float rain24 = _ttoi(str);    }
posted @ 2016-11-10 10:54  fyk1Ex  阅读(95)  评论(0)    收藏  举报