高手帮忙!>>>谁能提供一个访问网页的代码?只要把网页上的内容变成一个变量就可以了!!谢谢!! 比如输入http://sina.com/index.htm就会显示HTML代码不需要解译HTML语言,我只需要能下载内容就可以了,谢谢!!!有的话发给我呀!!!我的EMAIL:[email protected]发了EMAIL后回复一下,便于我给你分!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CInternetSession session; CInternetFile *file = (CInternetFile*) session.OpenURL("http://www.sina.com"); CString temp; while (file->ReadString(temp) != NULL) { m_Text+=temp; UpdateData(FALSE); }记得编译的时候#include <afxinet.h>m_Text是一个多行Edit的CString变量 我按照你的做了啊提示错误错误内容为--------------------Configuration: httphtml - Win32 Debug--------------------Compiling resources...Compiling...httphtmlDlg.cppF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'CInternetSession' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2146: syntax error : missing ';' before identifier 'session'F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'session' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'CInternetFile' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'file' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2059: syntax error : ')'F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : error C2227: left of '->ReadString' must point to class/struct/unionF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : fatal error C1903: unable to recover from previous error(s); stopping compilationGenerating Code...Compiling...httphtml.cppGenerating Code...Error executing cl.exe.httphtml.exe - 8 error(s), 0 warning(s) 记得编译的时候#include <afxinet.h> 记得编译的时候#include <afxinet.h>m_Text是一个多行Edit的CString变量 #include <afxinet.h>我填加了啊!!m_text我没填加, 我填加了m_text了,可是还有这么多错误:--------------------Configuration: httphtml - Win32 Debug--------------------Compiling...httphtmlDlg.cppF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'CInternetSession' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2146: syntax error : missing ';' before identifier 'session'F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'session' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'CInternetFile' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'file' : undeclared identifierF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2059: syntax error : ')'F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : error C2227: left of '->ReadString' must point to class/struct/unionF:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : fatal error C1903: unable to recover from previous error(s); stopping compilationGenerating Code...Compiling...httphtml.cppGenerating Code...Error executing cl.exe.httphtml.exe - 8 error(s), 0 warning(s) 用FindFile出错 BoundsChecker for vc2005 在哪有? 请问:如何使用下拉框实现获取本地驱动器列表? ★★轻松一刻★★ VC用ADO调用SQL SERVER 2000 存储过程的问题,在线等待,感谢回答 在大家的支持下,终于当上了版主。谢谢大家!放分! 各位朋友大家好,求教上位机与下位机的通信问题? 请问怎样知道微软内核动态库里提供的函数 抓下来的屏幕图像,剪切下一部分,用什么函数剪切呢。用什么方法实现呢。请高手指导,谢谢! Socket:AsyncSelect()何时调用? 哪儿有读取.shp文件的代码? 请教几个C++的class定义的问题
CString temp;
while (file->ReadString(temp) != NULL)
{
m_Text+=temp;
UpdateData(FALSE);
}记得编译的时候#include <afxinet.h>m_Text是一个多行Edit的CString变量
--------------------Configuration: httphtml - Win32 Debug--------------------
Compiling resources...
Compiling...
httphtmlDlg.cpp
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'CInternetSession' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2146: syntax error : missing ';' before identifier 'session'
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'session' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'CInternetFile' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'file' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2059: syntax error : ')'
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : error C2227: left of '->ReadString' must point to class/struct/union
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Compiling...
httphtml.cpp
Generating Code...
Error executing cl.exe.httphtml.exe - 8 error(s), 0 warning(s)
记得编译的时候#include <afxinet.h>m_Text是一个多行Edit的CString变量
我填加了啊!!
m_text我没填加,
--------------------Configuration: httphtml - Win32 Debug--------------------
Compiling...
httphtmlDlg.cpp
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'CInternetSession' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2146: syntax error : missing ';' before identifier 'session'
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(176) : error C2065: 'session' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'CInternetFile' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2065: 'file' : undeclared identifier
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(178) : error C2059: syntax error : ')'
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : error C2227: left of '->ReadString' must point to class/struct/union
F:\MY DOCUMENTS\临时程序\httphtml\httphtmlDlg.cpp(180) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Compiling...
httphtml.cpp
Generating Code...
Error executing cl.exe.httphtml.exe - 8 error(s), 0 warning(s)