VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get IE4 History URLs history folder

by Chris Wells (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

This code will open a DAT file in the c:\windows\history folder and pull out all sites visited

Assumes
For the Index.dat file the displacement is set to 119 for other files I have set the displacement to 15. For the Index.dat file the delimiter, or search string, is "URL " For other files I have used "Visited: " This example uses the Index.dat file, but you can easily modify it to get the others by making the documented changes to the code.
API Declarations

Rate Get IE4 History URLs history folder

Private Sub Command1_Click()
  
  Dim iDisplacement As Integer
  Dim iURLCount As Integer
  Dim sDelimiter As String
  Dim sData As String
  Dim sURLs(1 To 1000) As String
  Dim IEHistoryFile As String
  Dim i As Long
  Dim j As Long
  Dim x As Integer
  
  'For the Index.dat file the displacement is set to 119 for other files I  'have set the displacement to 15.
  
  iDisplacement = 119  'Index.dat = 119
  sDelimiter = "URL " '"Visited: "
  IEHistoryFile = "index.dat" 'Could also me an MM DAT file in History folder
  
  'For the Index.dat file the delimiter, or search string, is "URL "
  'For other files I have used "Visited: "
  
  
  
  'This is the History DAT file. I use Index.dat for this example, but there are MM files
  
  
  Open "c:\windows\history\" & IEHistoryFile For Binary As #1
  
  sData = Space$(LOF(1)) 'Data Buffer
  
  Get #1, , sData  'Places all data from file into buffer , sData
  
  Close #1  'Closes file
  
  
  
  i = InStr(i + 1, sData, sDelimiter) 'Looks for sdelimiter in sdata
  
  iURLCount = 0 'Sets URLCount to 0 because this is the beginning for the file
  
  While i < Len(sData)
  
   iURLCount = iURLCount + 1  'Keeps a count of how manu URLs are in the file
   
   If i > 0 Then
    j = InStr(i + iDisplacement - 1, sData, Chr$(0))
    'Place URL in an array
    sURLs(iURLCount) = Mid$(sData, i + iDisplacement, j - (i + iDisplacement))
   End If
   
   i = InStr(i + 1, sData, sDelimiter) 'Index = URL
   
   If i = 0 Then GoTo EndURLs 'If there are no more URLs then stop looping
   
  Wend
  
EndURLs:
  
  'This prints all URLs in Array in the debug window so you can see them
  For x = 1 To iURLCount
    Debug.Print sURLs(x)
  Next x
  
   
End Sub

Download this snippet    Add to My Saved Code

Get IE4 History URLs history folder Comments

No comments have been posted about Get IE4 History URLs history folder. Why not be the first to post a comment about Get IE4 History URLs history folder.

Post your comment

Subject:
Message:
0/1000 characters