[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

VB.NET Collect Windows Internet History into text document

Developing a app to collect internet explorer history for windows xp machines.
What I would like for this code to do would be to collect all the data in the history folder/subfolders and line by line, item by item record those itmes into a log.

Public Class Form1
    Dim DumpPath As String = "C:\TestDump\"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblUsername.Text = SystemInformation.UserName
        For Each HistoryItem As String In _
        My.Computer.FileSystem.GetFiles("c:\Documents And Settings\" & lblUsername.Text & "\local settings\History\", FileIO.SearchOption.SearchTopLevelOnly)
            listBox.Items.Add(HistoryItem)
        Next
        'Create Text File
        For Each ListItem In listBox.Items
            'Dim fileDetail As IO.FileInfo = My.Computer.FileSystem.GetFileInfo("c:\Documents And Settings\" & lblUsername.Text & "\local settings\History\" & ListItem.ToString)
            'My.Computer.FileSystem.WriteAllText(DumpPath & "History.rtf", ListItem.ToString & " - Created:" & fileDetail.CreationTime & " - Last Accessed" & fileDetail.LastAccessTime & vbNewLine, True)
            My.Computer.FileSystem.WriteAllText(DumpPath & "History.rtf", ListItem.ToString & vbNewLine, True)
        Next

        Me.Close()
    End Sub
End Class
0
ChrisVoisey
Asked:
ChrisVoisey
  • 6
  • 4
1 Solution
 
CodeCruiserCommented:
Try changing this

My.Computer.FileSystem.GetFiles("c:\Documents And Settings\" & lblUsername.Text & "\local settings\History\", FileIO.SearchOption.SearchTopLevelOnly)

to this

My.Computer.FileSystem.GetFiles("c:\Documents And Settings\" & lblUsername.Text & "\local settings\History\", "*.*")
0
 
CodeCruiserCommented:
This would return you all the files from all the subfolders within the history folder.
0
 
ChrisVoiseyAuthor Commented:
Worth a try but does not seem to be working.
"Conversion from string "*.*" to type integer is not valid...

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
CodeCruiserCommented:
Oh you are using the my object. Try this instead

Directory.GetFiles("path", "*.*")

http://msdn.microsoft.com/en-us/library/wz42302f.aspx
0
 
ChrisVoiseyAuthor Commented:
That is an improvement...

However the contents of the History folder are not as I expected.
All that is listed is some *.dat files, not the actual history as it appears when using windows explorer.

How do we get that data?

Thank you very much for your help!
0
 
CodeCruiserCommented:
I think that Windows uses a Shell Extension to show these files. Same as it uses to show the GAC folder(its not a HDD folder).
0
 
ChrisVoiseyAuthor Commented:
You are correct..

There still must be a way to collect that data, any thoughts?
0
 
CodeCruiserCommented:
0
 
ChrisVoiseyAuthor Commented:
Perfect!
Thank you very much!
0
 
CodeCruiserCommented:
Glad to help :-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now