想在程序中删除IE的临时目录中的文件!!

解决方案 »

  1.   

    IE临时目录的注册表存放地址:
    HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet  Settings\\Cache\\Paths\\Directory
    程序文件:Private Declare Function SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwndOwner As Long, ByVal nFolder As Integer, ppidl As Long) As LongPrivate Declare Function SHGetPathFromIDList Lib "Shell32" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal szPath As String) As LongPrivate Sub Command1_Click()
    Const MAX_PATH = 260
    Dim pidl As Long, S As StringId = &H20 ' IE临时目录
    S = String(MAX_PATH, 0)
    SHGetSpecialFolderLocation 0, Id, pidl
    SHGetPathFromIDList pidl, S
    S = Left(S, InStr(S, Chr(0)) - 1)MsgBox S
    End Sub
      

  2.   

    MsgBox CreateObject("shell.application").NameSpace(&H20).Self.Path
      

  3.   

    http://support.microsoft.com/kb/327569