Exemplo n.º 1
0
        public IEnumerable <FirefoxBookmarkEntry> GetBookmarkEntries(string username)
        {
            var placesDbPath = _disk.GetLocalFilePath($@"{GetProfilePath(username)}\places.sqlite");

            using (var conn = new SQLiteConnection($"Data Source={placesDbPath}"))
            {
                conn.Open();
                string           sql     = "SELECT * FROM moz_bookmarks INNER JOIN moz_places ON moz_bookmarks.fk = moz_places.id";
                SQLiteCommand    command = new SQLiteCommand(sql, conn);
                SQLiteDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    var      lastModified = DateTimeOffset.FromUnixTimeSeconds((long)reader["lastModified"] / 1_000_000).LocalDateTime;
                    DateTime?lastVisited  = null;
                    if (reader["last_visit_date"] is long lastVisit)
                    {
                        lastVisited = DateTimeOffset.FromUnixTimeSeconds(lastVisit / 1_000_000).LocalDateTime;
                    }
                    yield return(new FirefoxBookmarkEntry(reader["url"] as string, reader["title"] as string ?? string.Empty, lastVisited, lastModified, (long)reader["visit_count"]));
                }
                conn.Close();
            }
        }
Exemplo n.º 2
0
 private string GetDbPath(string skypeUserName) => _disk.GetLocalFilePath($@"{MainFolderPath}\{skypeUserName}\main.db");
Exemplo n.º 3
0
	    private string FindDbPath() => _disk.GetLocalFilePath($@"Users/{_userName}/AppData/Local/Google/Drive/user_default/sync_config.db");