Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Importing & Exporting bookmarks from IE, Opera, Netscape

Posted on 2003-11-07
5
Medium Priority
?
516 Views
Last Modified: 2010-04-05
I need the code for importing & exporting the bookmarks from/To Internet Explorer, Opera and NetScape.
The imported bookmarks should be read in a record like this:


TDatabase=record
          Category:String;                
          Files: array[1..200] of TFiles;

TFiles=record
               Title:string;
               URL:String;
               Description:String;
          end;

Also the categories i want to be included into treview (inserted into curent node).


ex:
 if the bookmarks from internet are:
             Business // -category
                  url1   desctription <--- if any
                  url2   desctription <--- if any
                  ....
            
            Fun // -category
                  url1   desctription <--- if any
                  url2   desctription <--- if any
                  ....
            
to be read like this:
      category[i]:=business;
      category[i].Files[1].Title:=Title of the url
      category[i].Files[1].Url:= url1
      category[i].Files[1].Description:= DEscription  of url1
      
      Category[i].Files[2].Title:=Title of the url
      category[i].Files[2].Url:= url1
      category[i].Files[2].Description:= DEscription  of url1

      ........
      
      category[i]:=Fun;
      category[i].Files[1].Title:=Title of the url
      category[i].Files[1].Url:= url1
      category[i].Files[1].Description:= DEscription  of url1

      Category[i].Files[2].Title:=Title of the url
      category[i].Files[2].Url:= url1
      category[i].Files[2].Description:= DEscription  of url1
      .........
0
Comment
Question by:so3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:fibdev
ID: 9705702
IE Favorites are stored in a directory...

Use this key to find the favorites directory of the current user...

add "Registry" to your uses list.

I was working on this, but I'm too tired to contiue.  maybe someone else can get it working...

unit Unit1;

interface

uses
  Windows, Messages, Registry, FileCtrl
,SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    function GetFavorites(): TStrings;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function TForm1.GetFavorites(): TStrings;
var Favorites : TStrings ;
    FavDir : String;
    Reg : TRegistry;
    Rec : TSearchRec;
begin
    Reg := TRegistry.Create;
    reg.RootKey := HKEY_CURRENT_USER;
    if not reg.KeyExists('\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders')
       then ShowMessage('Could not locate IE Favorites')
    else
    Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', False);
    FavDir := Reg.ReadString('Favorites');
    try
    if FavDir[Length(FavDir)] <> '\' then FavDir:= FavDir + '\';
    if FindFirst(FavDir+'*.*', faAnyFile, Rec) = 0 then
       repeat
        if (rec.attr and faDirectory > 0)and(rec.name <> '.')and(rec.name <> '..') then
         //GetFavorites(FavDir+rec.name+'\')
       else
       Favorites.Add(rec.Name);
  until FindNext(Rec) <> 0;
  FindClose(Rec);
  result := Favorites;
  finally
   reg.Free;
  end;
  end;
procedure TForm1.Button1Click(Sender: TObject);
begin
        listbox1.Items.AddStrings(GetFavorites);
end;

end.
0
 
LVL 6

Author Comment

by:so3
ID: 9708285
tnx for the code fibdev.
and for opera & netscape do you know how?
0
 
LVL 3

Accepted Solution

by:
fibdev earned 100 total points
ID: 9708453
It was late when I started that and I never did get that function working.  I think it's a step in the right direction, but it needs work.

here is a link for a vcl that will do exactly what you are after.  they want $15 for it though...

http://www.delphipages.com/edit/count.cfm?ID=1430
0
 
LVL 6

Author Comment

by:so3
ID: 9711124
with the code above i succeded to get the favorites in my list but now i don't know how to proceed with the bookmarks from Opera & NetScape
0
 
LVL 6

Author Comment

by:so3
ID: 9760257
Does anyone know how to import/export bookmarks from opera & Netscape or if there are any free components for doing this?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question