Solved

IE History Extractor

Posted on 2000-02-22
5
289 Views
Last Modified: 2010-05-02
Hello,  I am trying to make a program that will go through the entire contents of the IE history folder (in the directory of a user profile) and extract the URLs to a text file.  Does anyone have any idea how to do this.  Thanks
0
Comment
Question by:volodya16
[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
5 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 2546681
Yeah, did it a while ago in QBASIC. Lemme look around for the code...

M
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2546698
FOUND IT!

' =====================================
'
' Program to decode NETSCAPE.HST files
'
' By:   Mark M. Lambert on October 11, 1996
' This program produced with public funds and is therefore
' property of:
' United States Department of Defense
' US Army, STRICOM - UNCLASSIFIED
'
' =====================================
'
' Revision History:
' V1.01 - 14 Oct 96 - MML - Make it take file from command line
' V1.0  - 11 Oct 96 - MML - Initial Code
'
' =====================================
'
' This program will examine a binary NETSCAPE.HST file and do
' it's best to convert it into ASCII. The goal is to be able to tell
' what web sites a user has been visiting.
'
' Examination of a NETSCAPE.HST file shows it as a binary file with
' lots of HTTP:// references in it in ASCII. What we'll do is shuffle
' thru the file dropping out non-ASCII and watching for HTTP in the
' data stream. Every time we hit one we start a new line in the output
' file. Don't know waht exactly that will give us, but we've got to
' start somewhere.
'
' =====================================
'
' These subs were generated with the SUBSET.BAS program and are in
' the MARKSLIB.LIB sublibrary
'
DECLARE SUB cursor (row!, col!, text$)
DECLARE SUB center (row!, text$)
DECLARE SUB box (text$)
DECLARE SUB big.box (hi!)
DECLARE SUB menu (hi!, text$)
'
DECLARE FUNCTION getkey$ ()
'
COMMON urhc$, ulhc$, lrhc$, llhc$, hb$, vb$, tt$, bt$, rt$, lt$, cx$
COMMON xwide, top$, side$, horz$, bot$, cr$, lf$, ff$, esc$, bell$
'
urhc$   = CHR$(187)
ulhc$   = CHR$(201)
lrhc$   = CHR$(188)
llhc$   = CHR$(200)
hb$     = CHR$(205)
vb$     = CHR$(186)
tt$     = CHR$(203)
bt$     = CHR$(202)
rt$     = CHR$(185)
lt$     = CHR$(204)
cx$     = CHR$(206)
xwide   = 77
top$    = ulhc$ + STRING$(xwide, hb$) + urhc$
side$   = vb$ + STRING$(xwide, " ") + vb$
horz$   = lt$ + STRING$(xwide, hb$) + rt$
bot$    = llhc$ + STRING$(xwide, hb$) + lrhc$
cr$     = CHR$(13)
lf$     = CHR$(10)
ff$     = CHR$(12)
esc$    = CHR$(27)
bell$   = CHR$(7)
'
CONST   Zero = 0
CONST   False   = zero
CONST   True    = not false
'
width lprint 255
if instr( ucase$( environ$( "CRT" ) ), "M") = zero then color 7, 1
on error goto trap
'
main:
'
' Get file name from command line and make sure it makes sense
'
filename$ = ucase$( ltrim$( rtrim$( command$ ) ) )
'
' Strip any extension
'
dotmark = instr( filename$, "." )
if dotmark > zero then filename$ = left$( filename$, dotmark -1 )
'
' Reject fancy
'
if instr( filename$, "*") then goto drain
if instr( filename$, ":") then goto drain
if instr( filename$, "?") then goto drain
if instr( filename$, "\") then goto drain
if instr( filename$, "/") then goto drain
'
' Well, we've rejected all forms of trash, check for nothing passed in
'
if ( len( filename$ ) < 1 ) or _
   ( len( filename$ ) > 8 ) then filename$ = "NETSCAPE"
'
on error goto drain
open filename$ + ".HST" for binary as #1
open filename$ + ".LOG" for binary as #2
on error goto trap
'
' Ok, we've got the file, lets start looking for markers.
' We really need a sliding window for the markers
'
if eof(1) then goto done
'
' This is the core part of STRIPPER.BAS converted to run a byte at a
' time. We need to have a sliding window watching the character stream
' and queue up four characters at a time
'
marker$ = "HTTP://"
window$ = ""
'
main.loop:
        s.in$   = " "
        if eof(1) then goto done
'
' Reverse sequence for last record
'
        get #1,, s.in$
'
        if (s.in$ = "") then goto done
'
        byte%   = asc(s.in$)
'
' Only allow printable ASCII & limited control thru
'
        if (((byte% >= 32) and (byte% < 127))) then
                window$ = window$ + chr$( byte% )
'
' Save stripped record
'
                if len( window$ ) > len( marker$ ) then
                        lastchar$ = left$( window$, 1 )
                        window$ = right$( window$, len( window$ ) -1 )
                        window$ = ucase$( window$ )
                        if window$ = marker$ then
                                put #2,, cr$
                                put #2,, lf$
                                goto main.loop
                        endif
'
                        put 2,, lastchar$
                endif
        endif
'
'        if (byte%  = 13) then
'                put #2,, cr$
'                put #2,, lf$
'        endif
'
        goto main.loop
'=================

done:
put #2,, cr$
put #2,, lf$
close
'
drain:
SYSTEM
' =====================================
'
' Subroutines:
'
' =====================================
'
' Routine:      
' Pass:        
' Returns:
'
RETURN
' =====================================
'
' Routine:      TRAP
' Here on any unexpected error
'
TRAP:
PRINT "Internal Error #";err;" has occurred!"
RESUME DRAIN
' =====================================
' =====================================
'
' Fin
'
' =====================================
' =====================================
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2546779
This might help you a little bit.

"Retrieving the Internet Cache with FindFirst/NextUrlCacheEntry"
http://www.mvps.org/vbnet/code/fileapi/findfirstcacheentry.htm
0
 
LVL 14

Accepted Solution

by:
mcrider earned 200 total points
ID: 2546908
0
 

Author Comment

by:volodya16
ID: 2560578
Looks like exactly what I need - the only thing is when I run it I get "runtime error '9': subscript out of range" at this part:

sURLs(iURLCount) = Mid$(sData, i + iDisplacement, j - (i + iDisplacement))

Since I didn't write the code I would strain myself trying to figure out how the array is set up - I'm still a beginner :).  But if you have any ideas I am definitely listening!!!  Thanx
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 86
VBA: loop recent folder and copy txt file. 8 56
transition to visual .net from vb6 5 81
Fastest way to find and count same items VB6 16 62
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

739 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