-
Oct 19th, 2011, 03:17 AM
#1
Thread Starter
Banned
vb.net windows xp cookies raigeki
the following code will delete all the cookies, even the once that aren't deleted in IE ( internet explorer 8 ) from : tools, internet option, delete.
as a result of running the code the user will not be recognized or logged in to sites like youtube and various forums, in other words the user will effectively be logged out.
naturally, the user can relog in (sign in) to those sites.
Code:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
For Each f In Directory.GetFiles("C:\Documents and Settings\" & Environment.UserName & "\Cookies", "*.txt", SearchOption.AllDirectories)
File.Delete(f)
Next
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
' * delete cookies that ie doesn't delete from it's tools, delete
End Class
alternitively, on windows xp the user can delete the cookies manually :
start, run, cookies, delete all .txt files only.
-
Oct 25th, 2011, 12:54 PM
#2
Re: vb.net windows xp cookies raigeki
There's a bunch of things just plain wrong here, mainly you are assuming a lot of things you cannot assume.
- Who says my main hard drive is called "C"?
- Who says my "C" drive, if it even exists, contains a folder "Documents and Settings"?
You can find the path to a users' Documens & Settings folder via various different methods that always give you the right path. Some users might not even have a "C" drive, and even if they do you cannot assume that this is the drive that the Documents & Settings folder is in. Finally, but I'm not sure about this, isn't the Documents & Settings folder name different for different Windows languages?
What I'm trying to say is: you should use any of the framework methods that give you the path to the documents folder, not simply assume it is "C:\Documents & Settings", because very often it won't be.
Also, what is the Try/Catch block there for? It should at least be inside the For Each block. If one deletion fails (no access for example) then now you give up immediately on all remaining files as well. If the try catch block is inside the for each loop, you at least give each file a try, literally.
-
Oct 26th, 2011, 12:05 AM
#3
Thread Starter
Banned
Re: vb.net windows xp cookies raigeki
post the get cookies path if you have it.
'todo put try code in loop
-
Oct 26th, 2011, 02:02 AM
#4
Re: vb.net windows xp cookies raigeki
You should use code to return the path of the SpecialFolders rather than hard code them.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 26th, 2011, 03:51 AM
#5
Thread Starter
Banned
Re: vb.net windows xp cookies raigeki
are you sure a code for getting the cookie path exists ? if so post it plz
-
Oct 26th, 2011, 03:58 AM
#6
Re: vb.net windows xp cookies raigeki
It takes 3 seconds of googling...
http://tinyurl.com/3bet8dy
If that exact path doesn't work you can always try one of the many other SpecialFolders and go from there.
-
Oct 26th, 2011, 04:05 AM
#7
Re: vb.net windows xp cookies raigeki
There is a method to return the cookie path because I have done it in VB6 but I don't know what the vb.net equalivent would be.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Nov 3rd, 2011, 08:04 PM
#8
Re: vb.net windows xp cookies raigeki
Originally Posted by moti barski
are you sure a code for getting the cookie path exists ? if so post it plz
In my signature, you'll find a link to the temp cleaning project I started working on some time ago. I called it ACleaner.
You can look through the code and find better methods of getting temp data. There's a ton of different locations, besides just IE.
CodeBank contributions: Process Manager, Temp File Cleaner
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
Tags for this Thread
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
|