How to remove (delete) cookies from my computer using vb.net 2.0 programme code?

How to remove (delete) cookies from my computer using vb.net 2.0 programme code

Answer this question

How to remove (delete) cookies from my computer using vb.net 2.0 programme code?

  • MA Support

    I could have written this in pure .Net but decided to do it this way and let you decide.

    Const CSIDL_COOKIES = &H21
    Const SHGFP_TYPE_CURRENT = &H0

    Dim S As Object = CreateObject("WScript.Shell")
    Dim mystr As String= S.SpecialFolders("MyDocuments")

    mystr = Replace(mystr, "My Documents", "Cookies")

    Dim FSO As Object = CreateObject("Scripting.FileSystemObject")
    Dim Folder As Object = FSO.GetFolder(mystr)
    Dim File As Object

    'There's a dat file that can not be removed using this code. So, you'll need to determine if it is the enumerated file and then bypass it.

    For Each File In Folder.Files

    If File.Name <> "index.dat" Then

    FSO.DeleteFile (File.Path)

    End If

    Next

    next


  • How to remove (delete) cookies from my computer using vb.net 2.0 programme code?