#include <iOStream>#include <ctime>#include <cstrin
#include <iOStream>
#include <ctime>
#include <cstring>
#include <string>
#include <fstream>
#include <sstream>
#include <cstdlib>
using namespace std;
/造过wget 来获舰网页
string GethtmlBywget(string url)
//获软待下载网页文件名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()); //执wget
ifstream fin(fileName.c str()
);
if(!fin)
return
string strHtml =00char chTemp[1024] = "//凌软网真文件剑内存中
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; //返回网页源码
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 =“<div>用户名:";//13
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 <<“铁取网址”cepath <<end1;string data = GetHtmlByWget(path);
//cout << data << endl;
cout << y + 1900 <<"年"<< m + 1 <<“月"<< dd <<“日"<< endl;cout <<“用户名:密码:” <<endl;
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;
}
--结束END--
本文标题: c/c++实现获取NOD32升级账号密码
本文链接: https://lsjlt.com/news/405835.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0