maxkingmax 发表于 2009-12-10 07:57:01

论坛发帖 BUG

本帖最后由 maxkingmax 于 2009-12-10 17:45 编辑

使用源码贴进 Code模式 的时候, \\$ 将会变成 \\

找到原因了,是浏览器本身的原因,换成IE一切正常!
请版主关闭帖子!

xlcwxl 发表于 2009-12-10 09:46:55

本帖最后由 xlcwxl 于 2009-12-10 09:48 编辑

\\$
\\$
\\$测试\\$

xlcwxl 发表于 2009-12-10 09:47:25

测试测试测试\\$

maxkingmax 发表于 2009-12-10 17:41:00

本帖最后由 maxkingmax 于 2009-12-10 17:44 编辑

;~ #include-once
#include <File.au3>
#include <Array.au3>



;~ ============================================================================================
;~ 特定类型文件搜索
;~ Version    : 1.0
;~ Written by : 小包乖兔兔 修改:Maxkingmax
;~ Date       : 2009.04.20
;~ email    :226xb_tu@163.com 修改:Maxkingmax@126.com
;~ ============================================================================================
;~ _Find($path, $type, $flag,ByRef $result)
;~ _Findexp($path, $type, $flag,ByRef $result)
       
;~ ============================================================================================
;~ 参数说明:

;~ $path
;~ 表示要搜索的位置,如"E:\abc",表示E盘下的abc文件夹;

;~ $type
;在_Find()
;~ 表示文件类型,如".exe",一定要带点;要同时搜索多个文件可以使用"|"(竖线符,斜体不好区分)分隔多个
;~ 扩展名,如".bat|.txt"可以同时搜索文本文件和批处理文件
;在_Findexp()
;~ 必须是正则表达式的扩展名,支持多文件格式搜索(如: "\.(?i)txt$" 表示以Txt(忽略大小写)结尾的文件)
;("\.(?i)txt$|\.bat$" 表示以Txt(忽略大小写)结尾的文件和以bat(小写)结尾的文件)


;~ $flag
;~ 值为0,代表仅搜索该目录,不包括子目录;
;~ 值为1,代表搜索该目录及其以下的所有子目录;

;~ $result
;~ 表示要引用的数组,用来存放搜索结果,请先初始化要引用的数组为只拥有一个元素,如Dim $get

;~ 注:$result的值为搜索到的匹配个数
;~ ============================================================================================
;~ ============================================================================================
;~ 例子
;~ ============================================================================================
;~ Example1----------------搜索e盘的new文件夹下的所有txt和bat文本文件,包括子目录
;~ ============================================================================================
;~ dim $get
;~ _Find("k:\", ".bat|txt", 1,$get)
;~ _ArrayDisplay($get)

;~ ============================================================================================
;~ ============================================================================================
;~ Example2----------------搜索e盘的new文件夹下的所有txt文本文件,不包括子目录
;~ ============================================================================================
;~ Dim $get
;~ _Find("E:\new", ".txt", 0,$get)
;~ _ArrayDisplay($get)
;~ ============================================================================================
;~ ============================================================================================
;~ Example3----------------使用正则搜索e盘的new文件夹下的所有txt和Bat文件,不包括子目录
;~ ============================================================================================
;~ Dim $get
;~ _Findexp("E:\new", "\.(?i)txt$|\.(?i)bat$", 0,$get)
;~ _ArrayDisplay($get)
;~ ============================================================================================
;











Func _Findexp($path, $type, $flag , ByRef $result)

        $path=StringRegExpreplace($path,'\\,'')
        $FileListtmp = _FileListToArray($path)
      If isarray($FileListtmp) then
                For $i = 1 To $FileListtmp Step 1
                                        if stringregexp($FileListtmp[$i],$type) and stringregexp(filegetattrib($path & "\" &$FileListtmp[$i]),"D")=0 then
                                                _ArrayAdd($result,$path & "\" & $FileListtmp[$i])
                                                $result=UBound($result)-1
                                        Else
                                                If $flag == 1 Then
                                                _Findexp($path & "\" & $FileListtmp[$i], $type, $flag,$result)
                                                EndIf
                                        EndIf
                Next
      EndIf
EndFunc



Func _Find($path, $type, $flag,ByRef $result)

        $path=StringRegExpreplace($path,'\\,'')
        $typearray=stringsplit($type,"|",2)
        $FileListtmp = _FileListToArray($path)
      If isarray($FileListtmp) then
                For $i = 1 To $FileListtmp Step 1
                                        if _ArraySearch($typearray,        StringRegExpReplace($FileListtmp[$i], '.+\.', '.')) <> -1 and stringregexp(filegetattrib($path & "\" &$FileListtmp[$i]),"D")=0 then
                                               
                                                _ArrayAdd($result,$path & "\" & $FileListtmp[$i])
                                                $result=UBound($result)-1
                                        Else
                                                If $flag == 1 Then
                                                _Find($path & "\" & $FileListtmp[$i], $type, $flag,$result)
                                                EndIf
                                        EndIf
                Next
      EndIf
EndFunc 浏览器,我用的 OPERA 10 这是我直接复制并粘贴的
$path=StringRegExpreplace($path,'\\$','') 本来是这样的,粘贴后是这样的$path=StringRegExpreplace($path,'\\,'')$path=StringRegExpreplace($path,'\\$','')

jvlongwang 发表于 2009-12-16 09:07:50

纯支持一下。看来浏览Autoit 还得用IE啊。。上次遨游 2次附件下载失败 60金没了
页: [1]
查看完整版本: 论坛发帖 BUG