1
ファイルからクロム履歴を読みたい。私はそのファイルにあるすべての文字とnullバイトを取得したい。私が直面している問題は、ファイル内のテキストの一部しか取得できないということです。私はそれがnullバイトまたはspeical文字のために停止すると信じています。ヌルバイトを含むすべての文字を読む
ここに私のコードがあります。
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
int main(){
string str;
std::ifstream in("c:/Users/Petrus/Documents/History"); // I have copy my file into my documents to make sure I'm not interfering with Chrome.
std::stringstream buffer;
if (!in.is_open()){
cout << "Failed to open" << endl;
}
else{
cout << "Opened OK" << endl;
}
buffer << in.rdbuf();
std::string contents(buffer.str());
while (getline(buffer, str))
{
cout << str;
}
in.close();
system("PAUSE");
return 0;
}
あなたがChromeの履歴を見てみたい場合は、その時にあるファイル:
C:\ユーザーは\のAppData \ローカル\ Googleの\クローム\ユーザーデータ\既定YOUR NAMEを\ - >歴史
(PSあなたはAPPDATAを見ることができるように隠しファイルを含める必要があります。)事前に
おかげ
私はそれがWindows上でどうなっているのかわかりませんが、私のLinuxシステムでは、履歴データベースはちょうど*データベース*、より正確には[SQLite](https://www.sqlite.org/)データベースです。だから、何らかの処理をしたい、あるいはそこから情報を取得したいのであれば、適切なツール([SQLite](https://www.sqlite.org/))を開いて読んでおくべきでしょう。 –