VB 删除IE临时文件 的方法(IE6的浏览器)

来源:百度知道 编辑:UC知道 时间:2024/05/14 12:40:00
VB 在IE7中很容易删除临时文件,像这种语句就可以实现
Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8"
但在IE6中应该如何删除临时文件呢?
感谢。

用VB的FSO操作吧

Option Explicit
Private gstrSEP_DIR As String

Sub FPDeleteTree(inPath As String)

'定义临时变量
Dim tmpPath As String, curPath As String
Dim tmpFileName As String

'保存指定路径

curPath = inPath: AddDirSep curPath

'不理目录下文件属性,统统删除。

tmpFileName = Dir(curPath, vbNormal + vbHidden + vbSystem)

Do While Not tmpFileName = " "

SetAttr curPath & tmpFileName, vbNormal

Kill curPath & tmpFileName

tmpFileN