#include
#include
#include
#include
#include
#include
#include
using namespace std;
/造過wget 來獲艦網(wǎng)頁
string GetHtmlBywget(string url)
//獲軟待下載網(wǎng)頁文件名string fileName = url.substr(
(int)url.find last of("/") + 1);
if(fileName != "")
string strCom =“wget -q; //wget令,-q表示不顯示下截信息
strCom.append(ur1);
system(strCom.c str()); //執(zhí)wget
ifstream fin(fileName.c str()
);
if(!fin)
return
string strHtml =00char chTemp[1024] = "http://凌軟網(wǎng)真文件劍內(nèi)存中
while(
fin.getline(chTemp ,1024)
)
strHtml.append(
string(chTemp)
);
);
strcpy(chTemp ,
fin.close();
strCom =“del -f“; //剛除文件命令,-f競示直族剛除不做任何提示
strCom.append(fileName);
system(strCom.c_str()); //剛除剛才下我下來的文件return strHtml; //返回網(wǎng)頁源碼
else
return ..
string GetHtmlPath(int y, int m, int d)
stringstream str;
string now;
string path = "http://www.nod32jihuoma.cn/nod32-id/";
str << y + 190B;str >> now;path.append(now);path.append("-");
now.clear();
str.clear();
int month = m + 1;
if(month / 1 == @)
str << 日;
str >> now;path.append(now);now.clear();
str.clear();
str << month;
str >> now;
path.append(now);
path.append("-");
now.clear();
str.clear();
int day = d;
if(day / 1 == @)
str << 日;
str >> now;
path.append(now);
now.clear();str.clear();
str << day;
str >> now;
path.append(now);
path.append(".html");
now.clear();str.clear();
return path;
void SearchData(int n)
ofstream cout( key.txt ) ;
const string key =“
const string value = "密 碼:;//14
time t t = time(NULL);
struct tm* cur = localtime(&t);
int y = cur->tm year;
int m = cur->tm mon;
int d = cur->tm mday;
for(int i = @ ; i < n; i++)
int dd = d - i;
string path = GetHtmlPath(y, m, dd);
cout <<“鐵取網(wǎng)址”cepath < //cout << data << endl; cout << y + 1900 <<"年"<< m + 1 <<“月"<< dd <<“日"<< endl;cout <<“用戶名:密碼:” < for(size t pos = ; pos < data.size(); pos++) size t t = data.find(key,pos);if(t == string::npos) break; t += 13;for(int i = 1; i <= 14; i++,t++)cout << data[t];cout <<"t += 14;for(int i = 1; i <= 1; i++,t++)cout << data[t]; pos = t;cout << endl; cout.close(); int main() SearchData(2); string str; ifstream fin("key.txt"); while(fin) { getline(fin,str);cout << str << endl; str.clear(); { fin.close(); return 0; }