找回密码
 加入
搜索
查看: 7934|回复: 18

[AU3基础] 谁来写一个IE缓存提取工具

 火.. [复制链接]
发表于 2011-5-7 21:58:43 | 显示全部楼层 |阅读模式
谁来写一款IE缓存提取工具 就是那种,,能根据 后缀名,,提取 缓存文件,,方便快捷。

我将网络搜个遍,,发现有许多其他语言写的,,甚至批处理写的。。就是没有AU3写的。

各位达人,高手,,显示你们高深武功的时候到了。。

小弟在此先行感谢了!!!!
发表于 2011-5-7 22:39:22 | 显示全部楼层
随便改了改,你看看还有什么问题
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("按后缀找文件", 373, 370, 192, 124)
GUISetBkColor(0xA6CAF0)
$Button1 = GUICtrlCreateButton("查找", 216, 336, 89, 25)
$List1 = GUICtrlCreateList("", 0, 0, 369, 300)
$Label1 = GUICtrlCreateLabel("搜索状态", 8, 344, 196, 17)
$Label2 = GUICtrlCreateLabel("输入要搜索的后缀", 120, 300, 89, 25)
$listmenu1 = GUICtrlCreateContextMenu($List1);给一个控件建上下文菜单(右键菜单)
$menu1 = GUICtrlCreateMenuItem("打开路径", $listmenu1)
$input1 = GUICtrlCreateInput("", 216, 300, 89, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
            $houzui = GUICtrlRead($input1)
                $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $button1
                                        GUICtrlSetData($List1,"")
                    searchpst(@TempDir&"","*",$houzui);查找后缀名文件;
                        GUICtrlSetData($Label1,"搜索完成")        
        Case $menu1
            Run("Explorer /select, " & GUICtrlRead($list1))
        EndSwitch
WEnd

Func searchpst($patch,$str,$mask);自定义搜索函数
Local $search,$file,$array,$pst
$search = FileFindFirstFile($patch&$str)  
If $search  Then
While 1        
        $file = FileFindNextFile($search) 
        If @error Then ExitLoop
        $array=StringSplit($file,".")
        $pst =$array[UBound($array)-1]
        if $pst=$mask Then
                GUICtrlSetData($List1,$patch&$file)                 
                GUICtrlSetData($Label1,$patch&$file)
        EndIf           
        if FileChangeDir( $patch&$file)=1 Then
                searchpst($patch&$file&"",$str,$mask)                                
EndIf
WEnd
FileClose($search)
EndIf
EndFunc
 楼主| 发表于 2011-5-8 00:26:54 | 显示全部楼层
回复 2# 502762378

太谢谢您了。小弟还想请教一下,能否在搜索结果处,添加一个复制 和播放 按钮呢。

谢谢
发表于 2011-5-8 02:30:23 | 显示全部楼层
一切尽在帮助文档
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
Local $sItems
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("按后缀找文件", 373, 370, 192, 124)
GUISetBkColor(0xA6CAF0)
$Button1 = GUICtrlCreateButton("查找", 216, 336, 89, 25)
$List1 = GUICtrlCreateList("", 0, 0, 369, 300)

$Label1 = GUICtrlCreateLabel("搜索状态", 8, 344, 196, 17)
$Label2 = GUICtrlCreateLabel("输入要搜索的后缀", 120, 300, 89, 25)
$listmenu1 = GUICtrlCreateContextMenu($List1);给一个控件建上下文菜单(右键菜单)
$menu1 = GUICtrlCreateMenuItem("打开路径", $listmenu1)
$menu2 = GUICtrlCreateMenuItem("复制", $listmenu1)
$menu3 = GUICtrlCreateMenuItem("播放", $listmenu1)
$input1 = GUICtrlCreateInput("", 216, 300, 89, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $houzui = GUICtrlRead($input1)
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $button1
                        GUICtrlSetData($List1,"")
                        searchpst(@TempDir&"","*",$houzui);查找后缀名文件;
                        GUICtrlSetData($Label1,"搜索完成")        
        Case $menu1
            ;MsgBox(1,1,GUICtrlRead($List1))
                        Run("Explorer /select, " & GUICtrlRead($List1))
                Case $menu2                        
                        ClipPut(GUICtrlRead($List1))
                Case $menu3
                    Run(GUICtrlRead($List1))
        EndSwitch
WEnd

Func searchpst($patch,$str,$mask);自定义搜索函数
Local $search,$file,$array,$pst
$search = FileFindFirstFile($patch&$str)  
If $search  Then
While 1        
        $file = FileFindNextFile($search) 
        If @error Then ExitLoop
        $array=StringSplit($file,".")
        $pst =$array[UBound($array)-1]
        if $pst=$mask Then
                GUICtrlSetData($List1,$patch&$file)                 
                GUICtrlSetData($Label1,$patch&$file)
        EndIf           
        if FileChangeDir( $patch&$file)=1 Then
                searchpst($patch&$file&"",$str,$mask)                                
EndIf
WEnd
FileClose($search)
EndIf
EndFunc
发表于 2011-5-8 18:52:22 | 显示全部楼层
楼主有毛病呀,同一个问题发两个帖子
 楼主| 发表于 2011-5-8 22:50:47 | 显示全部楼层
回复 4# 502762378

非常感谢您的大力支持。。源码珍藏了。

但貌似 IE临时文件夹里面的文件搜索不到。。只有其他的。。我猜想是不是IE临时文件夹比较特殊。

不过,还是非常非常感谢您!!!
发表于 2011-5-9 08:44:57 | 显示全部楼层
努力打工赚钱了!
发表于 2011-5-9 23:59:16 | 显示全部楼层
让你看WInInet,不看...

自带都有例子了:
#Include <WinINet.au3>

; Initialize WinINet
_WinINet_Startup()

; Find the first of all cache entires
Global $avCacheEntry = _WinINet_FindFirstUrlCacheEntry()

If Not @error Then
        ; Pull the data out of the returned array
        Global $hCacheEntry = $avCacheEntry[0]
        Global $avCacheEntryInfo = $avCacheEntry[1]
        $avCacheEntry = 0

        While Not @error
                ; Print the currently found cache entry info
                ConsoleWrite("----------" & @CRLF)
                For $i = 0 To UBound($avCacheEntryInfo)-1
                        ConsoleWrite(StringFormat("--> [%d]: %s", $i, $avCacheEntryInfo[$i]) & @CRLF)
                Next
                ConsoleWrite("----------" & @CRLF & @CRLF)

                ; Find the next cache entry
                $avCacheEntryInfo = _WinINet_FindNextUrlCacheEntry($hCacheEntry)
        WEnd

        ; Close handles
        _WinINet_FindCloseUrlCache($hCacheEntry)
EndIf

; Cleanup
_WinINet_Shutdown()
 楼主| 发表于 2011-5-11 11:43:48 | 显示全部楼层
回复 8# republican

republican老大,谢谢您!请原谅我菜鸟,看不懂这么宝贵的源代码。

不知能否汉化一下,,即稍微注释下。

谢谢!!
发表于 2011-5-11 17:43:21 | 显示全部楼层
代码收下....
发表于 2011-5-13 13:17:16 | 显示全部楼层
回复 9# lxsh010


    伸手党一个,鉴定完毕
发表于 2011-5-13 17:37:28 | 显示全部楼层
不错,先收了,研究一下
发表于 2011-5-13 21:04:28 | 显示全部楼层
不错,过来支持下!
 楼主| 发表于 2011-5-13 22:23:26 | 显示全部楼层
回复 11# xx44t10

不好意思。俺也不想当伸手党,只是理解能力有限。
最后,我整合的是批处理版的。

谢谢各位的帮助和批评,吾将上下而求索。。
 楼主| 发表于 2011-5-13 22:24:09 | 显示全部楼层
回复 14# 小A

小A大大,见到你真好!!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 05:22 , Processed in 0.088461 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表