怎样让EDIT控件打开网络上的TXT文件?
比如让EDIT控件显示www.163.com/a.txt文件里的内容。
请问专家如何做?

解决方案 »

  1.   

    CString url, data;url= "www.163.com/a.txt";CInternetSession is;
    CHttpFile* phf = (CHttpFile*)is.OpenURL(url, 1,
    INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_RELOAD);data.Empty();
    CString sTmp;
    while( phf->ReadString(sTmp) )
    {
    data += sTmp;
    data += EL;
    }//while
      

  2.   

    好像要加http……
    url= "http://www.163.com/a.txt";
      

  3.   

    错误了呀
    error C2065: 'CInternetSession' : undeclared identifier
    error C2065: 'CHttpFile' : undeclared identifier
      

  4.   

    error C2065: 'EL' : undeclared identifier