下载网页源文件

奋斗小青年 2011-11-11 10:40:28
#include "stdafx.h"
#include <ReverseIP.h>
#include <afxinet.h>
#include <string>
#include <fstream>
#include <windows.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

using namespace std;




int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
CString strHello;
strHello.LoadString(IDS_HELLO);
//cout << (LPCTSTR)strHello << endl;
}

ofstream fout("Temp.txt");
ofstream ffout("GetDomains.txt");
ifstream fin("Domain.txt");//保存有域名
ifstream ffin("1.txt");
char domain[100];
char buff[100000];

CString m_urlhead="http://www.domaintools.com/reverse-ip/?hostname=";
CString m_html;
CString m_url;

while(fin.getline(domain,100))
{
for(int i=1;i<=10;i++)
{
CString page;
page.Format("&page=%d",i);
m_url=m_urlhead+domain+page;
//以下是获取网页内容
CInternetSession httpSession;
CInternetFile* htmlFile = (CInternetFile*) httpSession.OpenURL(m_url);
CString content;
char *p;
while (htmlFile->ReadString(content))
{
char *tag="http://whois.domaintools.com/";
if (p=strstr(content,tag))
{
fout<<p<<'\n';
break;
}
}
if(!p)
break;
htmlFile->Close();
httpSession.Close();
Sleep(10000);
}
}
return nRetCode;
}




这是我的代码 从别人资料下载的。 但是报这种错误:
1>d:\temptest\xiazaiwangye\xiazaiwangye\xiazaiwangye.cpp(2) : fatal error C1083: 无法打开包括文件:“ReverseIP.h”: No such file or directory
这个头文件是自己写的吗?我是下载的别人的资料,有的兄弟提供下。
...全文
226 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
奋斗小青年 2011-11-11
  • 打赏
  • 举报
回复
报一样的错误,我就在想是不是这个头文件是自己写的还是怎么的,郁闷
晓敬 2011-11-11
  • 打赏
  • 举报
回复
我可以提示你缺少了这个ReverseIP.h头文件。你可以尝试吧<>改成""。
在你找到头文件之后可能会缺失相应的实现库文件或者cpp文件。
其他的你就自立更生吧。
奋斗小青年 2011-11-11
  • 打赏
  • 举报
回复
大家帮下忙啊,急啊
__lhy 2011-11-11
  • 打赏
  • 举报
回复
可以直接使用URLDownLoadFile下载网页
libralibra 2011-11-11
  • 打赏
  • 举报
回复
#include <ReverseIP.h>估计是人家自己写的头文件,定义了一堆函数,不是系统自带的
zzcmx2008 2011-11-11
  • 打赏
  • 举报
回复
“ReverseIP.h”: No such file or directory

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧