18 Temmuz 2014 Cuma

Google Chrome browser History okuma

  DataTable ExtractFromTable(string table, string folder)
    {
        SQLiteConnection sql_con;
        SQLiteCommand sql_cmd;
        SQLiteDataAdapter DB;
        DataTable DT = new DataTable();

        // FireFox database file
        string dbPath = folder + "\\History";

        // If file exists
        if (File.Exists(dbPath))
        {
            // Data connection
            sql_con = new SQLiteConnection("Data Source=" + dbPath +
            ";Version=3;New=False;Compress=True;");

            // Open the Connection
            sql_con.Open();
            sql_cmd = sql_con.CreateCommand();

            // Select Query
            string CommandText = "select * from " + table;

            // Populate Data Table
            DB = new SQLiteDataAdapter(CommandText, sql_con);
            DB.Fill(DT);

            // Clean up
            sql_con.Close();
        }
        return DT;
    }
}
Class
class URL
{
    string url;
    string title;
    string browser;
    public URL(string url, string title, string browser)
    {
        this.url = url;
        this.title = title;
        this.browser = browser;
    }

    public string getData()
    {
        return browser + " - " + title + " - " + url;
    }
}

Hiç yorum yok:

Yorum Gönder