![]() |
| Le forum de référence en programmation et développement. Articles, cours et tutoriels du débutant au chef de projet et DBA confirmé. | |||||||
|
|||||||
| Général VBA Forum général VBA . Pour les logiciels spécifiques (Access, Excel, Word, ...), postez dans les bons sous forums. |
![]() |
|
|
Outils de la discussion |
|
|
#1 (permalink) |
|
Nouveau membre du Club
![]() Date d'inscription: mai 2007
Âge: 21
Messages: 65
|
Salut,
j'essaie d'écrire un module en vba qui va supprimer les TIF (temporary internet files). Seulement ce dossier est assez spécial, on y a pas assez aussi facilement que ça. Après plusieurs heures de recherche, j'ai pu trouver une dll : wininet.dll qui pourrait servir dans ce traitement. je pense être sur une piste, voici la liste des fonctions wininet : Code :
http://msdn.microsoft.com/en-us/library/aa385473(VS.85).aspx Dernière modification par AllyKo ; 23/05/2008 à 11h31 |
|
|
|
|
|
#2 (permalink) |
|
Nouveau membre du Club
![]() Date d'inscription: mai 2007
Âge: 21
Messages: 65
|
je poste la solution pour les autres, on ne sait jamais
Code :
Dim sGroupID As Date Dim hGroup As Long Dim hFile As Long Dim sEntryInfo As INTERNET_CACHE_ENTRY_INFO Dim iSize As Long On Error Resume Next ' Delete the groups hGroup = FindFirstUrlCacheGroup(0, 0, 0, 0, sGroupID, 0) ' To avoid error using it with IE4 as FindFirstUrlCacheGroup is not implemented If Err.Number <> 453 Then If (hGroup = 0) And (Err.LastDllError <> 2) Then MsgBox "An error occurred enumerating the cache groups" & Err.LastDllError Exit Sub End If Else Err.Clear End If If (hGroup <> 0) Then 'we succeeded in finding the first cache group.. enumerate and 'delete Do If (0 = DeleteUrlCacheGroup(sGroupID, CACHEGROUP_FLAG_FLUSHURL_ONDELETE, 0)) Then ' To avoid error using it with IE4 as FindFirstUrlCacheGroup is not implemented If Err.Number <> 453 Then MsgBox "Error deleting cache group " & Err.LastDllError Exit Sub Else Err.Clear End If End If iSize = BUFFERSIZE If (0 = FindNextUrlCacheGroup(hGroup, sGroupID, iSize)) And (Err.LastDllError <> 2) Then MsgBox "Error finding next url cache group! - " & Err.LastDllError End If Loop Until Err.LastDllError = 2 End If ' Delete the files sEntryInfo.dwStructSize = 80 iSize = BUFFERSIZE hFile = FindFirstUrlCacheEntry(0, sEntryInfo, iSize) If (hFile = 0) Then If (Err.LastDllError = ERROR_NO_MORE_ITEMS) Then GoTo done End If MsgBox "ERROR: FindFirstUrlCacheEntry - " & Err.LastDllError Exit Sub End If Do If (0 = DeleteUrlCacheEntry(sEntryInfo.szRestOfData(0))) _ And (Err.LastDllError <> 2) Then Err.Clear End If iSize = BUFFERSIZE If (0 = FindNextUrlCacheEntry(hFile, sEntryInfo, iSize)) And (Err.LastDllError <> ERROR_NO_MORE_ITEMS) Then MsgBox "Error: Unable to find the next cache entry - " & Err.LastDllError Exit Sub End If Loop Until Err.LastDllError = ERROR_NO_MORE_ITEMS done: MsgBox "cache cleared" 'Command1.Enabled = True |
|
|
|
|
![]() |
![]() |
||
WININET et Temporary internet files
|
||
| Outils de la discussion | |
|
|