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

简介:   #include void CReadInternetDataDlg::OnRead() {  CInternetSession c ;  CHttpFile * p=NULL ;  p=(CHttpFile*)c.
 

#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);

}

目录
相关文章
|
5月前
MFC文档类视图接收字符串
MFC文档类视图接收字符串
35 0
【POI】导出excel文件,不生成中间文件,直接将内存中的数据创建对象下载到浏览器
不是从InputStream中read,然后outputStream再write @RequestMapping("download4Excel") public void download4Excel(HttpServletResponse response){ XS...
1655 0