找回密码
 加入
搜索
查看: 2793|回复: 4

论坛发帖 BUG

[复制链接]
发表于 2009-12-10 07:57:01 | 显示全部楼层 |阅读模式
本帖最后由 maxkingmax 于 2009-12-10 17:45 编辑

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

找到原因了,是浏览器本身的原因,换成IE一切正常!
请版主关闭帖子!
发表于 2009-12-10 09:46:55 | 显示全部楼层
本帖最后由 xlcwxl 于 2009-12-10 09:48 编辑
\\$
\\$
\\$
[code]测试\\$[code]
发表于 2009-12-10 09:47:25 | 显示全部楼层
测试测试测试\\$
 楼主| 发表于 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[1]

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

;~ ============================================================================================
;~ ============================================================================================
;~ Example2----------------搜索e盘的new文件夹下的所有txt文本文件,不包括子目录
;~ ============================================================================================
;~ Dim $get[1]
;~ _Find("E:\new", ".txt", 0,$get)
;~ _ArrayDisplay($get)
;~ ============================================================================================
;~ ============================================================================================
;~ Example3----------------使用正则搜索e盘的new文件夹下的所有txt和Bat文件,不包括子目录
;~ ============================================================================================
;~ Dim $get[1]
;~ _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[0] Step 1
                                        if stringregexp($FileListtmp[$i],$type) and stringregexp(filegetattrib($path & "" &$FileListtmp[$i]),"D")=0 then
                                                _ArrayAdd($result,$path & "" & $FileListtmp[$i])
                                                $result[0]=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[0] Step 1
                                        if _ArraySearch($typearray,        StringRegExpReplace($FileListtmp[$i], '.+\.', '.')) <> -1 and stringregexp(filegetattrib($path & "" &$FileListtmp[$i]),"D")=0 then
                                                
                                                _ArrayAdd($result,$path & "" & $FileListtmp[$i])
                                                $result[0]=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,'\\,'')
[code]$path=StringRegExpreplace($path,'\\$','')
[/code]
发表于 2009-12-16 09:07:50 | 显示全部楼层
纯支持一下。看来浏览Autoit 还得用IE啊。。上次遨游 2次附件下载失败 60金没了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-4 16:44 , Processed in 0.074987 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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