Results 1 to 8 of 8

Thread: vb.net windows xp cookies raigeki

  1. #1

    Thread Starter
    Banned
    Join Date
    Mar 2009
    Posts
    764

    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.

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    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.

  3. #3

    Thread Starter
    Banned
    Join Date
    Mar 2009
    Posts
    764

    Re: vb.net windows xp cookies raigeki

    post the get cookies path if you have it.
    'todo put try code in loop

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    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

  5. #5

    Thread Starter
    Banned
    Join Date
    Mar 2009
    Posts
    764

    Re: vb.net windows xp cookies raigeki

    are you sure a code for getting the cookie path exists ? if so post it plz

  6. #6

  7. #7
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    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

  8. #8
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,828

    Re: vb.net windows xp cookies raigeki

    Quote Originally Posted by moti barski View Post
    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

    Quote 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
  •  



Click Here to Expand Forum to Full Width