|
-
Aug 5th, 2006, 06:04 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] clear cookies
hi all
is there a way to clear cookies???
i've currently worked this out but i don't know why it doesn't work...
System.IO.File.Delete("C:\Documentes and Settings\" & Environment.UserName.ToString & "Cookies\")
-
Aug 5th, 2006, 06:13 AM
#2
Addicted Member
Re: clear cookies
 Originally Posted by JXDOS
hi all
is there a way to clear cookies???
i've currently worked this out but i don't know why it doesn't work...
System.IO.File.Delete("C:\Documentes and Settings\" & Environment.UserName.ToString & "Cookies\")
to access the Cookies Folder use this code:
VB Code:
Environment.SpecialFolder.Cookies()
Regards,
=======================================
If I helped you, Kindly Rate my post. Thanks
-----------
PHENOM 
-
Aug 5th, 2006, 06:35 AM
#3
Re: clear cookies
You aren't specifying a file to delete. You've specified a folder. If you want to delete all cookies then you'd need to get a list of all the cookie files and then delete each one.
VB Code:
For Each cookieFile As String In IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Cookies), "*.txt")
Try
IO.File.Delete(cookieFile)
Catch
End Try
Next cookieFile
-
Aug 5th, 2006, 07:15 AM
#4
Thread Starter
Hyperactive Member
Re: clear cookies
it worx! it worx! thank a lot!
-
Aug 5th, 2006, 09:32 AM
#5
Re: clear cookies
Don't forget to resolve your thread from the Thread Tools menu.
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
|