|
-
Mar 30th, 2006, 10:39 AM
#1
Thread Starter
Frenzied Member
Getting list of visited websites
Hello, my younger brother has his own computer and internet connection (router) and we found out that he visits sites he shouldn't be visiting.
He knows how to clear the history of the websites he visits, but he doesn't know that there's a "Temporary Internet Files" folder with cookies and other files, that tell you from which website they came from.
I'd like to add the bad websites to his hosts file, but going to the properties of the cookies, copying the web addresses and pasting them into the hosts file manually takes quite a while.
Is there a way with VB to get these addresses from the filenames in the "Temporary Internet Files" folder, so I don't have to copy them all manually?
-
Mar 30th, 2006, 11:38 AM
#2
Re: Getting list of visited websites
If you open a cookie as a text file, there'll be an entry that ends in "/" (find it using InStr). You can use InStrRev from that point to find the previous vbLF. The site name starts at the character after the vbLF and ends with the "/".
Use Dir(*.txt) (for the first file and Dir with no argument for the rest of them) to find all the files in the cookies folder and parse them for the site names.
You can write entries to the hosts file with the information you get this way (read the file line by line, write it out line by line, then add the new lines from the cookie files. Then delete the old file and rename the new one) but how you're going to have a program determine which sites he can visit and which ones he can't is up to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|