begin process at 2012 02 13 22:37:31
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

VB.NET

 > VIDER LE CACHE INTERNET (VB.NET 2003)

VIDER LE CACHE INTERNET (VB.NET 2003)


 Information sur la source

Note :
7 / 10 - par 3 personnes
7,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :VB.NET Source .NET ( DotNet ) Classé sous :temporary, cache, internet Niveau :Initié Date de création :20/01/2006 Vu :13 923

Auteur : eldim

Ecrire un message privé
Commentaire sur cette source (26)
Ajouter un commentaire et/ou une note

 Description

Adaptation d'un source C# de la MSDN de Microsoft :
Suppression du cache d'internet explorer en VB.NET 2003

Source

  • Imports System
  • Imports System.Runtime.InteropServices
  • Public Class clsIE
  • ' Indicates that all of the cache groups in the user's system should be enumerated
  • Const CACHEGROUP_SEARCH_ALL As Integer = &H0
  • ' Indicates that all the cache entries that are associated with the cache group
  • ' should be deleted, unless the entry belongs to another cache group.
  • Const CACHEGROUP_FLAG_FLUSHURL_ONDELETE As Integer = &H2
  • ' File not found.
  • Const ERROR_FILE_NOT_FOUND As Integer = &H2
  • ' No more items have been found.
  • Const ERROR_NO_MORE_ITEMS As Integer = 259
  • ' For PInvoke: Contains information about an entry in the Internet cache
  • <StructLayout(LayoutKind.Explicit, Size:=80)> _
  • Public Structure INTERNET_CACHE_ENTRY_INFOA
  • <FieldOffset(0)> Public dwStructSize As Short
  • <FieldOffset(4)> Public lpszSourceUrlName As IntPtr
  • <FieldOffset(8)> Public lpszLocalFileName As IntPtr
  • <FieldOffset(12)> Public CacheEntryType As Short
  • <FieldOffset(16)> Public dwUseCount As Short
  • <FieldOffset(20)> Public dwHitRate As Short
  • <FieldOffset(24)> Public dwSizeLow As Short
  • <FieldOffset(28)> Public dwSizeHigh As Short
  • <FieldOffset(32)> Public LastModifiedTime As FILETIME
  • <FieldOffset(40)> Public ExpireTime As FILETIME
  • <FieldOffset(48)> Public LastAccessTime As FILETIME
  • <FieldOffset(56)> Public LastSyncTime As FILETIME
  • <FieldOffset(64)> Public lpHeaderInfo As IntPtr
  • <FieldOffset(68)> Public dwHeaderInfoSize As Short
  • <FieldOffset(72)> Public lpszFileExtension As IntPtr
  • <FieldOffset(76)> Public dwReserved As Short
  • <FieldOffset(76)> Public dwExemptDelta As Short
  • End Structure
  • ' For PInvoke: Initiates the enumeration of the cache groups in the Internet cache
  • <DllImport("wininet", _
  • SetLastError:=True, _
  • CharSet:=CharSet.Auto, _
  • EntryPoint:="FindFirstUrlCacheGroup", _
  • CallingConvention:=CallingConvention.StdCall)> _
  • Shared Function FindFirstUrlCacheGroup( _
  • ByVal dwFlags As Integer, _
  • ByVal dwFilter As Integer, _
  • ByVal lpSearchCondition As IntPtr, _
  • ByVal dwSearchCondition As Integer, _
  • ByRef lpGroupId As Long, _
  • ByVal lpReserved As IntPtr) As IntPtr
  • End Function
  • ' For PInvoke: Retrieves the next cache group in a cache group enumeration
  • <DllImport("wininet", _
  • SetLastError:=True, _
  • CharSet:=CharSet.Auto, _
  • EntryPoint:="FindNextUrlCacheGroup", _
  • CallingConvention:=CallingConvention.StdCall)> _
  • Shared Function FindNextUrlCacheGroup( _
  • ByVal hFind As IntPtr, _
  • ByRef lpGroupId As Long, _
  • ByVal lpReserved As IntPtr) As Boolean
  • End Function
  • ' For PInvoke: Releases the specified GROUPID and any associated state in the cache index file
  • <DllImport("wininet", _
  • SetLastError:=True, _
  • CharSet:=CharSet.Auto, _
  • EntryPoint:="DeleteUrlCacheGroup", _
  • CallingConvention:=CallingConvention.StdCall)> _
  • Shared Function DeleteUrlCacheGroup( _
  • ByVal GroupId As Long, _
  • ByVal dwFlags As Integer, _
  • ByVal lpReserved As IntPtr) As Boolean
  • End Function
  • ' For PInvoke: Begins the enumeration of the Internet cache
  • <DllImport("wininet", _
  • SetLastError:=True, _
  • CharSet:=CharSet.Auto, _
  • EntryPoint:="FindFirstUrlCacheEntryA", _
  • CallingConvention:=CallingConvention.StdCall)> _
  • Shared Function FindFirstUrlCacheEntry( _
  • <MarshalAs(UnmanagedType.LPTStr)> ByVal lpszUrlSearchPattern As String, _
  • ByVal lpFirstCacheEntryInfo As IntPtr, _
  • ByRef lpdwFirstCacheEntryInfoBufferSize As Integer) As IntPtr
  • End Function
  • ' For PInvoke: Retrieves the next entry in the Internet cache
  • <DllImport("wininet", _
  • SetLastError:=True, _
  • CharSet:=CharSet.Auto, _
  • EntryPoint:="FindNextUrlCacheEntryA", _
  • CallingConvention:=CallingConvention.StdCall)> _
  • Shared Function FindNextUrlCacheEntry( _
  • ByVal hFind As IntPtr, _
  • ByVal lpNextCacheEntryInfo As IntPtr, _
  • ByRef lpdwNextCacheEntryInfoBufferSize As Integer) As Boolean
  • End Function
  • ' For PInvoke: Removes the file that is associated with the source name from the cache, if the file exists
  • <DllImport("wininet", _
  • SetLastError:=True, _
  • CharSet:=CharSet.Auto, _
  • EntryPoint:="DeleteUrlCacheEntryA", _
  • CallingConvention:=CallingConvention.StdCall)> _
  • Shared Function DeleteUrlCacheEntry( _
  • ByVal lpszUrlName As IntPtr) As Boolean
  • End Function
  • <STAThread()> _
  • Public Sub sbDeleteALL(Optional ByVal Args() As String = Nothing)
  • Try
  • ' Pointer to a GROUPID variable
  • Dim groupId As Long = 0
  • ' Local variables
  • Dim cacheEntryInfoBufferSizeInitial As Integer = 0
  • Dim cacheEntryInfoBufferSize As Integer = 0
  • Dim cacheEntryInfoBuffer As IntPtr = IntPtr.Zero
  • Dim internetCacheEntry As INTERNET_CACHE_ENTRY_INFOA
  • Dim enumHandle As IntPtr = IntPtr.Zero
  • Dim returnValue As Boolean = False
  • enumHandle = FindFirstUrlCacheGroup(0, CACHEGROUP_SEARCH_ALL, IntPtr.Zero, 0, groupId, IntPtr.Zero)
  • If enumHandle.ToInt32 <> IntPtr.Zero.ToInt32 And _
  • ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() Then
  • Return
  • End If
  • While (True)
  • returnValue = DeleteUrlCacheGroup(groupId, CACHEGROUP_FLAG_FLUSHURL_ONDELETE, IntPtr.Zero)
  • If Not returnValue And ERROR_FILE_NOT_FOUND = Marshal.GetLastWin32Error() Then
  • returnValue = FindNextUrlCacheGroup(enumHandle, groupId, IntPtr.Zero)
  • End If
  • If Not returnValue And (ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() _
  • Or ERROR_FILE_NOT_FOUND = Marshal.GetLastWin32Error()) Then
  • Exit While
  • End If
  • End While
  • enumHandle = FindFirstUrlCacheEntry(String.Empty, IntPtr.Zero, _
  • cacheEntryInfoBufferSizeInitial)
  • If enumHandle.ToInt32 <> IntPtr.Zero.ToInt32 And _
  • ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() Then
  • Return
  • End If
  • cacheEntryInfoBufferSize = cacheEntryInfoBufferSizeInitial
  • cacheEntryInfoBuffer = Marshal.AllocHGlobal(cacheEntryInfoBufferSize)
  • enumHandle = FindFirstUrlCacheEntry(String.Empty, cacheEntryInfoBuffer, _
  • cacheEntryInfoBufferSizeInitial)
  • While (True)
  • internetCacheEntry = Marshal.PtrToStructure(cacheEntryInfoBuffer, _
  • GetType(INTERNET_CACHE_ENTRY_INFOA))
  • cacheEntryInfoBufferSizeInitial = cacheEntryInfoBufferSize
  • returnValue = DeleteUrlCacheEntry(internetCacheEntry.lpszSourceUrlName)
  • If Not returnValue Then
  • returnValue = FindNextUrlCacheEntry(enumHandle, cacheEntryInfoBuffer, _
  • cacheEntryInfoBufferSizeInitial)
  • End If
  • If Not returnValue And ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() Then
  • Exit While
  • End If
  • If Not returnValue And cacheEntryInfoBufferSizeInitial > _
  • cacheEntryInfoBufferSize Then
  • cacheEntryInfoBufferSize = cacheEntryInfoBufferSizeInitial
  • Dim tempIntPtr As New IntPtr(cacheEntryInfoBufferSize)
  • cacheEntryInfoBuffer = Marshal.ReAllocHGlobal(cacheEntryInfoBuffer, _
  • tempIntPtr)
  • returnValue = FindNextUrlCacheEntry(enumHandle, cacheEntryInfoBuffer, _
  • cacheEntryInfoBufferSizeInitial)
  • End If
  • End While
  • Marshal.FreeHGlobal(cacheEntryInfoBuffer)
  • Catch ex As Exception
  • gMsg.sbMsgCr(ex.Message, "clsIE.sbDeleteALL")
  • End Try
  • End Sub
  • End Class
Imports System
Imports System.Runtime.InteropServices
Public Class clsIE
    ' Indicates that all of the cache groups in the user's system should be enumerated
    Const CACHEGROUP_SEARCH_ALL As Integer = &H0
    ' Indicates that all the cache entries that are associated with the cache group
    ' should be deleted, unless the entry belongs to another cache group.
    Const CACHEGROUP_FLAG_FLUSHURL_ONDELETE As Integer = &H2
    ' File not found.
    Const ERROR_FILE_NOT_FOUND As Integer = &H2
    ' No more items have been found.
    Const ERROR_NO_MORE_ITEMS As Integer = 259

    ' For PInvoke: Contains information about an entry in the Internet cache
    <StructLayout(LayoutKind.Explicit, Size:=80)> _
    Public Structure INTERNET_CACHE_ENTRY_INFOA
        <FieldOffset(0)> Public dwStructSize As Short
        <FieldOffset(4)> Public lpszSourceUrlName As IntPtr
        <FieldOffset(8)> Public lpszLocalFileName As IntPtr
        <FieldOffset(12)> Public CacheEntryType As Short
        <FieldOffset(16)> Public dwUseCount As Short
        <FieldOffset(20)> Public dwHitRate As Short
        <FieldOffset(24)> Public dwSizeLow As Short
        <FieldOffset(28)> Public dwSizeHigh As Short
        <FieldOffset(32)> Public LastModifiedTime As FILETIME
        <FieldOffset(40)> Public ExpireTime As FILETIME
        <FieldOffset(48)> Public LastAccessTime As FILETIME
        <FieldOffset(56)> Public LastSyncTime As FILETIME
        <FieldOffset(64)> Public lpHeaderInfo As IntPtr
        <FieldOffset(68)> Public dwHeaderInfoSize As Short
        <FieldOffset(72)> Public lpszFileExtension As IntPtr
        <FieldOffset(76)> Public dwReserved As Short
        <FieldOffset(76)> Public dwExemptDelta As Short
    End Structure

    ' For PInvoke: Initiates the enumeration of the cache groups in the Internet cache
    <DllImport("wininet", _
            SetLastError:=True, _
            CharSet:=CharSet.Auto, _
            EntryPoint:="FindFirstUrlCacheGroup", _
            CallingConvention:=CallingConvention.StdCall)> _
    Shared Function FindFirstUrlCacheGroup( _
        ByVal dwFlags As Integer, _
        ByVal dwFilter As Integer, _
        ByVal lpSearchCondition As IntPtr, _
        ByVal dwSearchCondition As Integer, _
        ByRef lpGroupId As Long, _
        ByVal lpReserved As IntPtr) As IntPtr
    End Function
    ' For PInvoke: Retrieves the next cache group in a cache group enumeration
    <DllImport("wininet", _
        SetLastError:=True, _
        CharSet:=CharSet.Auto, _
        EntryPoint:="FindNextUrlCacheGroup", _
        CallingConvention:=CallingConvention.StdCall)> _
    Shared Function FindNextUrlCacheGroup( _
        ByVal hFind As IntPtr, _
        ByRef lpGroupId As Long, _
        ByVal lpReserved As IntPtr) As Boolean
    End Function

    ' For PInvoke: Releases the specified GROUPID and any associated state in the cache index file
    <DllImport("wininet", _
        SetLastError:=True, _
        CharSet:=CharSet.Auto, _
        EntryPoint:="DeleteUrlCacheGroup", _
        CallingConvention:=CallingConvention.StdCall)> _
    Shared Function DeleteUrlCacheGroup( _
        ByVal GroupId As Long, _
        ByVal dwFlags As Integer, _
        ByVal lpReserved As IntPtr) As Boolean
    End Function

    ' For PInvoke: Begins the enumeration of the Internet cache
    <DllImport("wininet", _
        SetLastError:=True, _
        CharSet:=CharSet.Auto, _
        EntryPoint:="FindFirstUrlCacheEntryA", _
        CallingConvention:=CallingConvention.StdCall)> _
    Shared Function FindFirstUrlCacheEntry( _
        <MarshalAs(UnmanagedType.LPTStr)> ByVal lpszUrlSearchPattern As String, _
        ByVal lpFirstCacheEntryInfo As IntPtr, _
        ByRef lpdwFirstCacheEntryInfoBufferSize As Integer) As IntPtr
    End Function
    ' For PInvoke: Retrieves the next entry in the Internet cache
    <DllImport("wininet", _
        SetLastError:=True, _
        CharSet:=CharSet.Auto, _
        EntryPoint:="FindNextUrlCacheEntryA", _
        CallingConvention:=CallingConvention.StdCall)> _
    Shared Function FindNextUrlCacheEntry( _
        ByVal hFind As IntPtr, _
        ByVal lpNextCacheEntryInfo As IntPtr, _
        ByRef lpdwNextCacheEntryInfoBufferSize As Integer) As Boolean
    End Function

    ' For PInvoke: Removes the file that is associated with the source name from the cache, if the file exists
    <DllImport("wininet", _
        SetLastError:=True, _
        CharSet:=CharSet.Auto, _
        EntryPoint:="DeleteUrlCacheEntryA", _
        CallingConvention:=CallingConvention.StdCall)> _
    Shared Function DeleteUrlCacheEntry( _
        ByVal lpszUrlName As IntPtr) As Boolean
    End Function

    <STAThread()> _
    Public Sub sbDeleteALL(Optional ByVal Args() As String = Nothing)
        Try
            ' Pointer to a GROUPID variable
            Dim groupId As Long = 0

            ' Local variables
            Dim cacheEntryInfoBufferSizeInitial As Integer = 0
            Dim cacheEntryInfoBufferSize As Integer = 0
            Dim cacheEntryInfoBuffer As IntPtr = IntPtr.Zero
            Dim internetCacheEntry As INTERNET_CACHE_ENTRY_INFOA
            Dim enumHandle As IntPtr = IntPtr.Zero
            Dim returnValue As Boolean = False

            enumHandle = FindFirstUrlCacheGroup(0, CACHEGROUP_SEARCH_ALL, IntPtr.Zero, 0, groupId, IntPtr.Zero)
            If enumHandle.ToInt32 <> IntPtr.Zero.ToInt32 And _
                    ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() Then
                Return
            End If
            While (True)
                returnValue = DeleteUrlCacheGroup(groupId, CACHEGROUP_FLAG_FLUSHURL_ONDELETE, IntPtr.Zero)
                If Not returnValue And ERROR_FILE_NOT_FOUND = Marshal.GetLastWin32Error() Then
                    returnValue = FindNextUrlCacheGroup(enumHandle, groupId, IntPtr.Zero)
                End If

                If Not returnValue And (ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() _
                        Or ERROR_FILE_NOT_FOUND = Marshal.GetLastWin32Error()) Then
                    Exit While
                End If
            End While

            enumHandle = FindFirstUrlCacheEntry(String.Empty, IntPtr.Zero, _
                    cacheEntryInfoBufferSizeInitial)
            If enumHandle.ToInt32 <> IntPtr.Zero.ToInt32 And _
                    ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() Then
                Return
            End If

            cacheEntryInfoBufferSize = cacheEntryInfoBufferSizeInitial
            cacheEntryInfoBuffer = Marshal.AllocHGlobal(cacheEntryInfoBufferSize)
            enumHandle = FindFirstUrlCacheEntry(String.Empty, cacheEntryInfoBuffer, _
                cacheEntryInfoBufferSizeInitial)

            While (True)
                internetCacheEntry = Marshal.PtrToStructure(cacheEntryInfoBuffer, _
                    GetType(INTERNET_CACHE_ENTRY_INFOA))

                cacheEntryInfoBufferSizeInitial = cacheEntryInfoBufferSize
                returnValue = DeleteUrlCacheEntry(internetCacheEntry.lpszSourceUrlName)
                If Not returnValue Then
                    returnValue = FindNextUrlCacheEntry(enumHandle, cacheEntryInfoBuffer, _
                        cacheEntryInfoBufferSizeInitial)
                End If
                If Not returnValue And ERROR_NO_MORE_ITEMS = Marshal.GetLastWin32Error() Then
                    Exit While
                End If
                If Not returnValue And cacheEntryInfoBufferSizeInitial > _
                        cacheEntryInfoBufferSize Then

                    cacheEntryInfoBufferSize = cacheEntryInfoBufferSizeInitial

                    Dim tempIntPtr As New IntPtr(cacheEntryInfoBufferSize)
                    cacheEntryInfoBuffer = Marshal.ReAllocHGlobal(cacheEntryInfoBuffer, _
                        tempIntPtr)
                    returnValue = FindNextUrlCacheEntry(enumHandle, cacheEntryInfoBuffer, _
                        cacheEntryInfoBufferSizeInitial)
                End If
            End While
            Marshal.FreeHGlobal(cacheEntryInfoBuffer)
        Catch ex As Exception
            gMsg.sbMsgCr(ex.Message, "clsIE.sbDeleteALL")
        End Try
    End Sub
End Class



 Sources du même auteur

Source avec Zip Source .NET (Dotnet) OPENOFFICE CALC
Source .NET (Dotnet) EXÉCUTER DU CODE VB.NET À PARTIR D'UN PROGRAMME EN COURS D'E...
Source .NET (Dotnet) RECTANGLES ARRONDIS
Source .NET (Dotnet) RÉCUPÉRER LE NOM DU PC CONNECTÉ À UN SERVEUR EN TERMINAL SER...
Source .NET (Dotnet) EXÉCUTION D'UN THREAD SANS SURCHARGER LE PROCESSEUR

 Sources de la même categorie

Source .NET (Dotnet) MODIFICATION DATE DE WINDOWS EN VB.NET ET VBA par us_30
Source avec Zip Source avec une capture Source .NET (Dotnet) ENVOI DE MAIL AVEC PIÈCE JOINTE par EhJoe
Source .NET (Dotnet) AMUSONS NOUS AVEC UN LABEL ^^ par Adn56
Source avec Zip Source avec une capture Source .NET (Dotnet) UN NAVIGATEUR INTERNET EN VB.NET par azrti
Source avec Zip Source .NET (Dotnet) CONVERSION DE DEVISE MONAITAIRE VIA UN SERVICE WEB par bigmonkey7

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture Source .NET (Dotnet) UN NAVIGATEUR INTERNET EN VB.NET par azrti
Source avec Zip Source avec une capture Source .NET (Dotnet) NAVIGATEUR WEB par ouattararomuald
Source avec Zip Source avec une capture Source .NET (Dotnet) TÉLÉCHARGEUR DE FICHIER SUR MEGAUPLOAD par tomalex1
Source avec Zip Source avec une capture CONNEXION INTERNET AVEC LOGIN ET MOT DE PASSE À PARTIR D'EXC... par IAORANA
Source .NET (Dotnet) VIDER LE CACHE INTERNET DE TOUS LES UTILISATEURS D'UN SERVEU... par eldim

Commentaires et avis

Commentaire de eldim le 20/01/2006 12:07:22

Simple traduction, utile pour l'intégration à d'autres sources VB.NET

Commentaire de OneHacker le 21/01/2006 13:26:52

Qu'est ce que t'apelle le cache internet, la liste de tous les urls dernierement utilisée ?

Commentaire de eldim le 23/01/2006 09:23:31

Le répertoire Temporary Internet Files et ses sous répertoires

Commentaire de OneHacker le 27/01/2006 10:04:15

En ce cas là je pense qu'il y a juste besoin de ma nipuler avec l' IO.
Moi j'ai fait un programme qui permet de supprimer les cookies + l'historique + la liste de la barre adresse Internet Explorer et la fenêtre "Exécuter".

Commentaire de eldim le 27/01/2006 10:22:21

Ton source n'est pas sur le site...
Montre le pour que ta critique soit constructive

Commentaire de nadjim le 30/01/2006 14:37:09

Peut tu donner l'adresse de ton source en C#, puisque que le C# m'interresse plus particulièrement. Merci

Commentaire de eldim le 30/01/2006 15:33:24

C sur la msdn de microsoft

Commentaire de TroXsA le 06/02/2006 18:03:14

Bonjour,

Beaucoup de code pour rien !
avec un petit Imports system.environement
et utiliser la class specialfloder (de tete)
et avec un file.delete de system.io tout ce fait tout seul, il y a pas besion de faire au temps de code pour effecer des cache de IE

Cordialement

Commentaire de eldim le 07/02/2006 07:42:59

Ah oui j'avais pas vu

pas bête

à tester

Commentaire de eldim le 07/02/2006 08:11:21

Heu...
TroXsA ta solution n'est pas viable
Je viens de la tester

Le répertoire IE Cache n'étant pas un vrai répertoire les commandes de suppression de fichier ne fonctionnent pas

A+

Commentaire de TroXsA le 08/02/2006 10:27:49

Parceque il faut rechercher le pourquoi du comment mais c'est assez simple a faire (surtout avec la version de visual studio 2005 c'est encore plus simple)

Si vous voulez je vous fait un exemple ...

http://troxsa.info

Commentaire de eldim le 08/02/2006 11:16:24

désolé je n'ai que la version 2003, tous mes codes .NET sont sur cette version

Commentaire de TroXsA le 08/02/2006 11:21:44

Oui en version 2003 c'est aussi facile, bon je vous fait un exemple aujourd'hui et je vous donnerais le code ...

http://troxsa.info/

Commentaire de TroXsA le 08/02/2006 11:56:46

Bon voila j'ai fait ça vite fait c'est peut etre pas aussi optimiser comme on le souhaiterais, sa efface quel que fichier mais pas l'integralité, tous les fichiers en "Lecture Seule" ne sont pas  effacer, il faut simplement ajouté un bout de code pour changer les attribu de fichier pour qu'il les efface mais je vous laisse le faire ... ou si vous voulez je le ferais plus tard !

Voila mon exemple

Les imports :
Imports System
Imports System.IO
Imports System.Environment

Variable private :
Private AllFiles As New ArrayList
________________________________________________________
Une Function Private :
________________________________________________________
    Private Function Recherche(ByVal ListDir As String) As String
        Try
            For Each Dossier As String In Directory.GetDirectories(ListDir)

                For Each Fichier As String In Directory.GetFiles(Dossier)
                    AllFiles.Add(Fichier)
                Next
                Recherche(Dossier)
            Next

        Catch e As Exception
            Return 0
        End Try
    End Function
________________________________________________________
Puis le code qui permet d'effacer tout ça ;)
________________________________________________________
        ' Récuperation du path dossier "Temporary Internet Files"
        '
        Dim DossierIE As String = Environment.GetFolderPath(SpecialFolder.InternetCache)

        '
        ' Recherche tous les dossiers & fichier (même les fichiers caché)
        '
        Recherche(DossierIE)

        '
        ' Lecture de toutes les item du ArrayList puis efface les fichiers
        '
        For i As Integer = 0 To AllFiles.Count - 1
            On Error Resume Next
            System.IO.File.Delete(AllFiles.Item(i))
        Next
_____________________________________________________
voilà
si vous souhaitez je le met sur site VBfrance en version amélioré et un peut plus commenter

http://troxsa.info


Commentaire de eldim le 08/02/2006 12:08:01

j'avais déja essayé ça et ça ne fonctionne pas

va voir dans ton cache ie t'auras une surprise

Commentaire de TroXsA le 08/02/2006 12:45:19

Justement c'est ce que j'ai dit :
plusieurs fichier et dossier sont en lecture seule il faut changer leurs attributions afin qu'il puisse s'effacer

sinon dans le meme style on peut aussi effacer tout les dossiers au lieux d'effacer tout les fichiers,c'est plus rapide et plus radical, pour voir tous les dossiers il faut effacer le fichier qui s'appel desktop.ini dans le dossier Temporary ...

et mon code efface bien des fichiers, mais effectiment il efface pas tout du aux attributions de fichier

Je peux faire un code plus poucé pour qu'il efface tout, c'est comme j'ai pu dire c'est juste un exemple que j'ai fait vite fait

Commentaire de eldim le 08/02/2006 13:44:33

Merci pour le 1/10 alors que ce n'est que la traduction du code de microsoft proposé par la MSDN

Merci de leur transmettre la note

Commentaire de OneHacker le 20/02/2006 00:10:27

Va voir ma source : http://www.vbfrance.com/code.aspx?ID=36142

Redman

Commentaire de ririeli le 27/02/2006 23:17:52

Bonjour tout le monde!! enfin ce que je cherchais..!  je cherchais un moyen d'effacer le contenu du dossier "Temporary Internet Files" avant de faire mes sauvegardes, maintenant que je crois l'avoir trouvé, quelqu'un pourrait me dire ce que je dois faire exactement avec ce code pour effacer le contenu de ce dossier...?  merci merci merci beaucoup d'avance

Commentaire de eldim le 28/02/2006 07:37:12

Salut !

tu as juste à lancer sbDeleteALL

Commentaire de ririeli le 28/02/2006 20:58:28

Bonjour!!!

salut Eldi, merci bcp de ta réponse mais j'ai oublié de remarquer que je ne connais pas grand chose en programation....  jijiji    je dois copier oú ce code et l'executer comment? désolé mais je ne sais pas ce que c'est sbDeleteALL... merci bcp, soyez patient SVP...

Elizabeth R.R.

Commentaire de eldim le 01/03/2006 07:45:40

Ben, tu copie la totalité dans une nouvelle class que tu nomme clsIE
(Click droit sur projet puis Ajouter/Ajouter une class)

Ensuite dans l'événement d'un bouton par exemple tu peux faire
dim CL as new clsIE
cl.sbDeleteALL

Commentaire de djjo le 17/06/2008 19:47:52

bonjour et bravo 10/10 il fonctionne parfaitement en vb 2008 et il efface vraiment tous et n'a rien a voir comme certain le dise entre les dossiers et le cache reel internet. je l'avais en vb6 et commencais a l'adapter pour vb2008 (donc un grand merci sa m'evite du travail)
j'ai put tester les 2 et le resultat ai identique tous est bien supprimer...

Commentaire de eldim le 18/06/2008 07:49:07

merci, enfin un qui comprend le code...

Commentaire de achills le 13/08/2008 16:06:48 10/10

10/10 ton code fonctionne correctement
tu ma été d'une grande aide

Commentaire de eldim le 13/08/2008 16:26:38

merci

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Effacer les 'temporary internet files' [ par ZeViRuS ] slt a tousun pote m'a demandé de lui faire un petit navigateur web qui efface aussi les temporary internet filesje n'arrive pas a trouver le codej'ess Temporary Internet Files [ par casi ] Comment effacer le contenu de ce dossier par VB ? Temporary Internet Files [ par casi ] Comment effacer le contenu de ce dossier par VB ? Temporary Internet files [ par casi ] Je cherche à éffacer les fichiers du dossier"Temporary Internet files" par VB ... sans succés (permission refusée).Si vous avez une astuce; je suis pr Temporary Internet Files [ par donald ] Salut !Comment vider en VB6 le répertoire :C:\WINDOWS\Temporary Internet FilesMerci et @+ Temporary internet files [ par drudy ] Comment acceder au objects (gif par exemple) dans le repertoire temporary internet files. Il a une structure bizarre, et même sous dos , rien apparait


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,593 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales