View Full Version : is it possible to read from cookies folder ???
jackdaniels
10-22-2008, 06:49 AM
i wonder if it is possible to read data and links from cookies folder to web object ???
Teqskater
10-22-2008, 06:53 AM
Yes it is:
Look in the manual for TextFile.ReadToTable
or TextFile.ReadToString.
jackdaniels
10-22-2008, 06:54 AM
thanks for answer, is it possible to give a small example ???
Teqskater
10-22-2008, 07:02 AM
If you can tell me where the cookies are i might help you. Im not into websites and cookies you know. Just help me started and i see what i can do.
jackdaniels
10-22-2008, 07:05 AM
well my cookies r here ;
C:\Documents and Settings\Jack\Cookies
but is it possible to find computer name(mine is Jack) automaticly ???
Teqskater
10-22-2008, 07:07 AM
Yes thats possible to. Ill start right away and watch this topic in about 15-30 minutes. then it should be done i think. ;)
but hey wait. There not only HTTP links init. there's a bunch of other info in there to. Just the links right?
jackdaniels
10-22-2008, 07:09 AM
no also users for the sites too...
Teqskater
10-22-2008, 07:38 AM
Well this code gives you the windows username
MyMusicFolder = Shell.GetFolder(SHF_MYMUSIC); -- MyMmusicFolder will be C:\Documents and Settings\Your Windows Username\My Documents\My Music
UserNameFind_Part1 = String.Replace(MyMusicFolder, "C:\\Documents and Settings\\", "", true); -- This will make UserNameFind_Part1: Your Windows Username\My Documents\My Music
UserNameFind_Part2 = String.Find(UserNameFind_Part1, "\\", 1, true); -- This will search the next Slash in the string Your Windows Username\My Documents\My Music and return its position
Windows_Username = String.Left(UserNameFind_Part1, UserNameFind_Part2-1); -- This will remove everything behind the windows user name in the string UserNameFind_Part1 and leaves you the windows username
The variable Windows_Username will contain in your case "Jack", but for another user it will contain their windows username.
Now, the path to your cookies folder can be created like this:
CookieFolder = "C:\\Documents and Settings\\"..Windows_Username.."\\Cookies"
Then you can use TextFile.ReadToTable to load a cookie like this:
CookieContentTable = TextFile.ReadToTable(CookieFolder.."\\CookieNameHere.txt");
CookieContentTable[1] will be containing line one of the cookie
CookieContentTable[2] will be containing line two of the cookie
etc....
You can use File.Find in the cookie folder to get al .txt files(cookies) and return them to a table.
Then you need to find a way to find URL's in the cookies by proparly using String.Find.
That should get you started. I wish i could create you a full working example but i can't because i dont know exactly how a cookie is created and how it's structured.
Hope this helps,
Teqskater. :yes
jackdaniels
10-22-2008, 07:41 AM
thanks alot Teqskater :yes
Ulrich
10-22-2008, 08:03 AM
(...)
Now, the path to your cookies folder can be created like this:
CookieFolder = "C:\\Documents and Settings\\"..Windows_Username.."\\Cookies"
Be careful, this will not work on other languages of the operating system, nor will it work on Vista or on another future OS!
A better and OS and language independent way to find the cookie folder was already shown here (http://www.indigorose.com/forums/showpost.php?p=124267&postcount=4).
Ulrich
Teqskater
10-22-2008, 08:55 AM
Alright Ulrich, thanks for the tip. Im dutch and im using a dutch windows Xp and it still works for me.
Ulrich
10-22-2008, 09:17 AM
Ok, I should have written that it might not work on different languages. :p
Your method definitely doesn't work on my system (XP as well), as I pointed the "My Music" folder to a proper folder on my F: partition, and the proposed method doesn't work at all on Windows Vista. Vista is two years old now, and we should already be writing compatible programs.
Ulrich
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.