Solved

Internet History

Posted on 2003-11-01
8
308 Views
Last Modified: 2010-04-05
Hey folks....
Iv been trawling through the net trying to find a solution to my question, but without any success.
I need to find a simple way of displaying my computors internet history in a memo box. I have seen this question answered on here before, however they all suggest downloading certain components from the net etc.... is there not just a way of doing it in normal code without components?
Note: i dont need it to be fancy, or modify the history in any way.... just a little bit of coding, which when say button1 is pressed, memo1 displays the computors internet history!
Anyhelp is greatly appreciated!

King Regards
James
0
Comment
Question by:Greenandroid
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:DeerBear
ID: 9665211
Hi,

Before posting a question, one should always try and find a way to
solve his/her own problems.

Specifically, looking for history in regedit, you come across this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

Where you find a value, labelled "history" that points to a folder.
In that folder, you'll find some sub folders you can access to
obtain the data you want.

To list the subfolders, use FindFirst/FindNext/FindClose functions.

HTH,

Andrew
0
 
LVL 9

Assisted Solution

by:ginsonic
ginsonic earned 30 total points
ID: 9665449
0
 
LVL 2

Author Comment

by:Greenandroid
ID: 9665667
hmm.....
ok, il start with ginsonic....
ok... well first of all, i am aware of the Turlhistory component, and have already got that component installed on my computor.....however as i previously mentioned, ideally i need just a bit of code to add the history to a simple memo box.... The problem with the tUrlHitory component is that it seems to work perfectly in its examples, but seems to 'rip itself to pieces' when i try to get it to display the urls in a memo box.....
Il quite happily give you the points if you could give me a SMALL piece of code, using that component, that JUST adds the urls from the history folder to a memo upon the click of a button.... the demos included with tUrlHistory are much more advanced than i need (displaying dates etc) - a simple list of urls is all i need!

Now to deerbea.....
You say that 'one should not post until one has tried solving it themselves' - Well to be honest, i wouldnt be posting my question on here unless i had previously tried it, and got nowhere! Now to your comment..... I am aware that you can do it through the registry keys, however i must admit, i do not have any experience in this area at all. I have never had to use the registry in any of my applications before, which is why i would need further guidence. If, like you said, its possible through the key you mentioned, please could you write a small code which will do as i said? (Press a button and the list of urls from the history is displayed in a memo box!)
As with ginsin, i'd quite happily give you the points if you could do that!

Well thanks for the comments so far anyway, and im looking forwards to hearing back from you all!
Kind Regards
James
0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9665887
Hi,

I had a test on it, to see if needed recursion and so on, but it
seems impossible to be done via "normal" code due to the
strange behaviour of the folder under DOS and Windows.

Thus, I devoted my attention to the History component, and I
though of a way to do it with that one:

Just issue a "DeleteHistory" handling the "OnDelete" event.
When you're in there, just add the URL to the memo and set
"Delete" to false to preserve it.

HTH,

Andrew
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Author Comment

by:Greenandroid
ID: 9666193
sorry, but please could you explain a little more in depth on what you mean....
Is this using the tUrlHistory component?

Also, please could you explain in a more step to step guide for me.... im not that used to the terms you use fro delphi, as i am newer to delphi than any other language i know... sorry to be a bit of a pain!

Kind Regards
James
0
 
LVL 2

Author Comment

by:Greenandroid
ID: 9666268
Well thank god for that!!!

Iv just managed to get it to work perfectly for what i needed, and all i needed to use was the urlhistory component, and arrays!

Just to put you all out your misery, this is how simple it really was!
--------------------------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
  count, total: Integer;
begin
  Total:=UrlHistory1.Enumerate;
  For count:=0 to Total-1 do
    begin
       memo1.Lines.Add(PEntry(Urlhistory1.Items[count]).Url);
    end;
end;
--------------------------------------------------------------------------------------

Looks so simple once you've worked it out!
I think il still try and give you both some points if i work out how, just for pointing me in the kinda right direction.... Thanks for all your help!
0
 
LVL 5

Accepted Solution

by:
DeerBear earned 70 total points
ID: 9666284
Hi,

Yes, I examined the possibility to walk through the entries via
plain code, but I noticed it was very difficult to do.

Thus, I explored the TUrlHistory component, to see if it was easier to
accomplish.

According to its documentation there's an event called "OnDelete"
that gets called each time you are going to delete an URL from history.

Its format is:

OnDelete(Title, Url: String; LastVisited, LastUpdated, Expires: TDateTime;
var Delete: Boolean);

Now, according to this prototype, you can see the Delete parameter
that can be changed. A value of True means "go on deleting" and a
value of False means "do not delete".

If you examine the documentation further, you'll see a method called

DeleteEntries

Which( according to documentation ) deletes all entries from the history
list.

IF the documentation is complete, this means that calling DeleteEntries will
issue as many OnDelete events as the number of items in the history list.

If you examine well the OnDelete event, you'll notice a parameter called
URL that, according to the documentation, contains the URL about to be
deleted.

This means that calling DeleteEntries will, among other things, iterate the
history list reporting each and every url in it.

This means you can do something like this

procedure MyForm.MyUrlDelete(Title, Url: String; LastVisited,LastUpdated,
Expires: TDateTime; var Delete: Boolean);
begin
   URLMemo.Lines.Add( Url );
   Delete := False;
end;

and call from your button:

procedure MyForm.MyButtonClick( Sender: TObject );
begin
   MyUrl.DeleteEntries;
end;

Now, if you place on your form a memo component naming it MyMemo,
name the form "MyForm" and the button you'll place "MyButton",
pasting the above code will display the URLs directly in the memo.

HTH,

Andrew
0
 
LVL 2

Author Comment

by:Greenandroid
ID: 9666824
Thanks again guys...
let me explain what i have done for you quickly!

Well i managed to solve the problem myself (read above)....HOWEVER i wished to thank you guys for helping me, and so have given you the points anyway!

I have given ginsonic 20 points for suggesting a component (which i already had) but helped with DeerBears answers :P

I have given you the remaining 80 points DeerBear, as you have typed an awful lot, and hope its some reward to your aching fingers :P

Kind regards!
James
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now