MFC 利用 CHttpFile类从网页读取 数据

 

#include <afxinet.h>
void CReadInternetDataDlg::OnRead()
{
 CInternetSession c ;
 CHttpFile * p=NULL ;
 p=(CHttpFile*)c.OpenURL("http://127.0.0.1/web") ;   //打开一个URL
 CString str ;
 CString info="";
 while(p->ReadString(str))   //读取网页数据
  info+=str ;

    (this->GetDlgItem(IDC_EDIT1))->SetWindowText(info);

}

你可能感兴趣的:(c,null,mfc,include)