JeromeB
Active Members-
Posts
74 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
JeromeB's Achievements
Wayfarer (2/7)
0
Reputation
-
Still looking for some help about this
-
Looks like pretty ugly, i do not know how to remplace this part with a loop to go to more than 3 sub... For $i = 1 to UBound($array) - 1 If IsDir($dir & $array[$i]) Then $out = $out & " <li>" & $array[$i] $array2 = _FileListToArrayEx($dir & $array[$i], "*", 16) $out = $out & " <ul>" For $j = 1 to UBound($array2) - 1 If IsDir($dir & $array[$i] & "\" & $array2[$j]) Then $out = $out & " <li>" & $array2[$j] $array3 = _FileListToArrayEx($dir & $array[$i] &"\"& $array2[$j], "*", 16) $out = $out & " <ul>" For $k = 1 to UBound($array3) - 1 If IsDir($dir & $array[$i] & "\" & $array2[$j] & "\" & $array3[$k]) Then $out = $out & " <li>" & $array3[$k] & "</li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array3[$k] & "</li>" EndIf Next $out = $out & " </ul>" $out = $out & " </li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array2[$j] & "</li>" EndIf Next $out = $out & " </ul>" $out = $out & " </li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array[$i] & "</li>" EndIf NextI can get output like that in my array : with local $dir = "C:\Program Files (x86)\AutoIt3\" $array = _FileListToArrayEx($dir, "*", 12) Row|Col 0 [1]|C:\Program Files (x86)\AutoIt3\Au3Check.dat [2]|C:\Program Files (x86)\AutoIt3\Au3Check.exe [3]|C:\Program Files (x86)\AutoIt3\Au3Info.exe [4]|C:\Program Files (x86)\AutoIt3\Au3Info_x64.exe [5]|C:\Program Files (x86)\AutoIt3\Aut2Exe [6]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2exe.exe [7]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2exe_x64.exe [8]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons [9]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v10_256x256_RGB-A.ico [10]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v10_48x48_256.ico [11]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v10_48x48_RGB-A.ico [12]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v9_48x48_256.ico [13]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v9_48x48_RGB-A.ico [14]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Old1.ico [15]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Old2.ico [16]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Old3.ico [17]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Old4.ico [18]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP01.ICO [19]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP02.ICO [20]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP03.ICO [21]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP04.ICO [22]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP05.ICO [23]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP06.ICO [24]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP07.ICO [25]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP08.ICO [26]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP09.ICO [27]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP10.ICO [28]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP11.ICO [29]|C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP12.ICO [30]|C:\Program Files (x86)\AutoIt3\Aut2Exe\upx.exe [31]|C:\Program Files (x86)\AutoIt3\AutoIt v3 Website.url [32]|C:\Program Files (x86)\AutoIt3\AutoIt.chm [33]|C:\Program Files (x86)\AutoIt3\AutoIt3.exe [34]|C:\Program Files (x86)\AutoIt3\AutoIt3Help.exe [35]|C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe [36]|C:\Program Files (x86)\AutoIt3\AutoItX [37]|C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX.chm [38]|C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.Assembly.dll [39]|C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.Assembly.xml [40]|C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.dll
-
The function is included, i do not attach an UDF but i added the function into the main script Here anyway the help from the UDF : ; #FUNCTION# ======================================================================================================================================================= ; Name...........: _FileListToArrayEx ; Description ...: Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch) ; Syntax.........: _FileListToArrayEx($sPath[, $sFilter = "*"[, $iFlag = 0]]) ; Parameters ....: $sPath - Path to generate filelist for. ; $sFilter - Optional the filter to use, default is *. (Multiple filter groups such as "All "*.png|*.jpg|*.bmp") Search the Autoit3 helpfile for the word "WildCards" For details. ; $iFlag - Optional: specifies whether to return files folders or both Or Full Path (add the flags together for multiple operations): ; |$iFlag = 0 (Default) Return both files and folders ; |$iFlag = 1 Return files only ; |$iFlag = 2 Return Folders only ; |$iFlag = 4 Search SubDirectory ; |$iFlag = 8 Return Full Path ; |$iFlag = 16 $sFilter do Case-Sensitive matching (By Default $sFilter do Case-Insensitive matching) ; |$iFlag = 32 Disable the return the count in the first element - effectively makes the array 0-based (must use UBound() to get the size in this case). ; By Default the first element ($array[0]) contains the number of file found, the remaining elements ($array[1], $array[2], etc.) ; |$iFlag = 64 $sFilter is REGEXP Mod, See Pattern Parameters in StringRegExp (Can not be combined with flag 16) ; |$iFlag = 128 Return Backslash at the beginning of the file name, example Return "\Filename1.xxx" (Can not be combined with flag 8) ; Return values .: Failure - @Error ; |1 = Path not found or invalid ; |2 = Invalid $sFilter ; |3 = No File(s) Found ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: The array returned is one-dimensional and is made up as follows: ; $array[0] = Number of Files\Folders returned ; $array[1] = 1st File\Folder ; $array[2] = 2nd File\Folder ; $array[3] = 3rd File\Folder ; $array[n] = nth File\Folder ; Related .......: ; Link ..........: ; Example .......: Yes ; Note ..........: Special Thanks to SolidSnake & Tlem ; ==================================================================================================================================================================
-
Hey, My problem is not to get all file and directory and sub of it. I can do it with _FileListToArrayEx($dir & $array[$i], "*", 4) My problem is building the tree. I do not know how to exploit the array to build a complete tree of my disk... Right now i got this, which is working, but not fully. (have a try) #include <File.au3> #include <Array.au3> global $out = "" $out = $out & "<!DOCTYPE html>" $out = $out & "<head>" $out = $out & ' <link rel="stylesheet" href="http://static.jstree.com/3.1.1/assets/bootstrap/css/bootstrap.min.css" />' $out = $out & ' <link rel="stylesheet" href="http://static.jstree.com/3.1.1/assets/dist/themes/default/style.min.css" />' $out = $out & " <script>window.$q=[];window.$=window.jQuery=function(a){window.$q.push(a);};</script>" $out = $out & "<body>" $out = $out & ' <div id="jstree1" class="demo">' $out = $out & " <ul>" $out = $out & " <li>C:\Program Files (x86)" local $dir = "C:\Program Files (x86)\" $array = _FileListToArrayEx($dir, "*", 2) _ArrayDisplay($array) $out = $out & " <ul>" For $i = 1 to UBound($array) - 1 If IsDir($dir & $array[$i]) Then $out = $out & " <li>" & $array[$i] $array2 = _FileListToArrayEx($dir & $array[$i], "*", 16) $out = $out & " <ul>" For $j = 1 to UBound($array2) - 1 If IsDir($dir & $array[$i] & "\" & $array2[$j]) Then $out = $out & " <li>" & $array2[$j] & "</li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array2[$j] & "</li>" EndIf Next $out = $out & " </ul>" $out = $out & " </li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array[$i] & "</li>" EndIf Next $out = $out & " </ul>" $out = $out & " </li>" $out = $out & " </ul>" $out = $out & " </div>" $out = $out & " <script>" $out = $out & " $(function () {" $out = $out & " $('#jstree1').jstree();" $out = $out & " });" $out = $out & " </script>" $out = $out & ' <script src="http://static.jstree.com/3.1.1/assets/jquery-1.10.2.min.js"></script>' $out = $out & ' <script src="http://static.jstree.com/3.1.1/assets/dist/jstree.min.js"></script>' $out = $out & " <script>$.each($q,function(i,f){$(f)});$q=null;</script>" $out = $out & "</body>" $out = $out & "</html>" FileDelete(@ScriptDir & "\testree.html") $file = FileOpen(@ScriptDir & "\testree.html", 1) FileWriteLine($file, $out) FileClose($file) Func IsDir($sFilePath) Return StringInStr(FileGetAttrib($sFilePath), "D") > 0 EndFunc ;==>IsDir Func _FileListToArrayEx($sPath, $sFilter = "*", $iFlag = 0) $sPath = StringRegExpReplace($sPath & "\", "(?!\A)[\\/]+\h*", "\\") If Not FileExists($sPath) Then Return SetError(1, 1, "") If StringRegExp($sFilter, StringReplace('^\s*$|\v|[\\/:><"]|^\||\|\||\|$', "[" & Chr(BitAND($iFlag, 64) + 28) & '\/:><"]|^\||\|\||\|$', "\\\\")) Then Return SetError(2, 2, "") Local $hSearch, $sFile, $sFileList, $sSubDir = BitAND($iFlag, 4), $sDelim = "|", $sDirFilter = StringReplace($sFilter, "*", "") $hSearch = FileFindFirstFile($sPath & "*") If @Error Then Return SetError(3, 3, "") Local $hWSearch = $hSearch, $hWSTMP, $SearchWD, $Extended, $iFlags = StringReplace(BitAND($iFlag, 1) + BitAND($iFlag, 2), "3", "0") If BitAND($iFlag, 8) Then $sDelim &= $sPath If BitAND($iFlag, 128) Then $sDelim = "|\" If Not BitAND($iFlag, 64) Then $sFilter = StringRegExpReplace(BitAND($iFlag, 16) & "(?i)(", "16\(\?\i\)|\d+", "") & StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace($sFilter, "[^*?|]+", "\\Q$0\\E"), "\\E(?=\||$)", "$0\$"), "(?<=^|\|)\\Q", "^$0"), "\*+", ".*") & ")" While 1 $sFile = FileFindNextFile($hWSearch) If @Error Then If $hWSearch = $hSearch Then ExitLoop FileClose($hWSearch) $hWSearch -= 1 $SearchWD = StringLeft($SearchWD, StringInStr($SearchWD, "\", 1, -2)) ElseIf $sSubDir Then $Extended = @Extended If ($iFlags + $Extended <> 2) Then If $sDirFilter Then If StringRegExp($sFile, $sFilter) Then $sFileList &= $sDelim & $SearchWD & $sFile Else $sFileList &= $sDelim & $SearchWD & $sFile EndIf EndIf If Not $Extended Then ContinueLoop $hWSTMP = FileFindFirstFile($sPath & $SearchWD & $sFile & "\*") If $hWSTMP = -1 Then ContinueLoop $hWSearch = $hWSTMP $SearchWD &= $sFile & "\" Else If ($iFlags + @Extended = 2) Or StringRegExp($sFile, $sFilter) = 0 Then ContinueLoop $sFileList &= $sDelim & $sFile EndIf WEnd FileClose($hSearch) If Not $sFileList Then Return SetError(3, 3, "") Return StringSplit(StringTrimLeft($sFileList, 1), "|", StringReplace(BitAND($iFlag, 32), "32", 2)) EndFunc ;==>_FileListToArrayEx
-
Ye have tried but seems pretty useless in my case. The only thing i dont know how to make is the recursivity (i need to a loop) to make very sub ans sub and sub directory and file until nothing anymore. Have tried something like that, but its not the right way i think For $i = 1 to UBound($array) - 1 If IsDir($dir & $array[$i]) Then $out = $out & " <li>" & $array[$i] $array2 = _FileListToArrayEx($dir & $array[$i], "*", 16) $out = $out & " <ul>" For $j = 1 to UBound($array2) - 1 If IsDir($dir & $array[$i] & "\" & $array2[$j]) Then $out = $out & " <li>" & $array2[$j] & "</li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array2[$j] & "</li>" EndIf Next $out = $out & " </ul>" $out = $out & " </li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array[$i] & "</li>" EndIf Next
-
Hello, I'm trying to build a tree (with file and folder) in html, but i can't get what i want. I want to get the file and folder for the entire folder. (inclugind sub directory and subfile, and subsub directory ....) If you can help me out. Here is my code actually : #include <File.au3> #include <Array.au3> global $out = "" $out = $out & "<!DOCTYPE html>" $out = $out & "<head>" $out = $out & ' <link rel="stylesheet" href="http://static.jstree.com/3.1.1/assets/bootstrap/css/bootstrap.min.css" />' $out = $out & ' <link rel="stylesheet" href="http://static.jstree.com/3.1.1/assets/dist/themes/default/style.min.css" />' $out = $out & " <script>window.$q=[];window.$=window.jQuery=function(a){window.$q.push(a);};</script>" $out = $out & "<body>" $out = $out & ' <div id="jstree1" class="demo">' $out = $out & " <ul>" $out = $out & " <li>C:\Program Files (x86)" local $dir = "C:\Program Files (x86)\" $array = _FileListToArrayEx($dir, "*", 16) $out = $out & " <ul>" For $i = 1 to UBound($array) - 1 If IsDir($dir & $array[$i]) Then $out = $out & " <li>" & $array[$i] & "</li>" Else $out = $out & " <li data-jstree='" & '{ "icon" : "glyphicon glyphicon-leaf" }' & "'>" & $array[$i] & "</li>" EndIf Next $out = $out & " </ul>" $out = $out & " </li>" $out = $out & " </ul>" $out = $out & " </div>" $out = $out & " <script>" $out = $out & " $(function () {" $out = $out & " $('#jstree1').jstree();" $out = $out & " });" $out = $out & " </script>" $out = $out & ' <script src="http://static.jstree.com/3.1.1/assets/jquery-1.10.2.min.js"></script>' $out = $out & ' <script src="http://static.jstree.com/3.1.1/assets/dist/jstree.min.js"></script>' $out = $out & " <script>$.each($q,function(i,f){$(f)});$q=null;</script>" $out = $out & "</body>" $out = $out & "</html>" FileDelete(@ScriptDir & "\testree.html") $file = FileOpen(@ScriptDir & "\testree.html", 1) FileWriteLine($file, $out) FileClose($file) Func IsDir($sFilePath) Return StringInStr(FileGetAttrib($sFilePath), "D") > 0 EndFunc ;==>IsDir Func _FileListToArrayEx($sPath, $sFilter = "*", $iFlag = 0) $sPath = StringRegExpReplace($sPath & "\", "(?!\A)[\\/]+\h*", "\\") If Not FileExists($sPath) Then Return SetError(1, 1, "") If StringRegExp($sFilter, StringReplace('^\s*$|\v|[\\/:><"]|^\||\|\||\|$', "[" & Chr(BitAND($iFlag, 64) + 28) & '\/:><"]|^\||\|\||\|$', "\\\\")) Then Return SetError(2, 2, "") Local $hSearch, $sFile, $sFileList, $sSubDir = BitAND($iFlag, 4), $sDelim = "|", $sDirFilter = StringReplace($sFilter, "*", "") $hSearch = FileFindFirstFile($sPath & "*") If @Error Then Return SetError(3, 3, "") Local $hWSearch = $hSearch, $hWSTMP, $SearchWD, $Extended, $iFlags = StringReplace(BitAND($iFlag, 1) + BitAND($iFlag, 2), "3", "0") If BitAND($iFlag, 8) Then $sDelim &= $sPath If BitAND($iFlag, 128) Then $sDelim = "|\" If Not BitAND($iFlag, 64) Then $sFilter = StringRegExpReplace(BitAND($iFlag, 16) & "(?i)(", "16\(\?\i\)|\d+", "") & StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace($sFilter, "[^*?|]+", "\\Q$0\\E"), "\\E(?=\||$)", "$0\$"), "(?<=^|\|)\\Q", "^$0"), "\*+", ".*") & ")" While 1 $sFile = FileFindNextFile($hWSearch) If @Error Then If $hWSearch = $hSearch Then ExitLoop FileClose($hWSearch) $hWSearch -= 1 $SearchWD = StringLeft($SearchWD, StringInStr($SearchWD, "\", 1, -2)) ElseIf $sSubDir Then $Extended = @Extended If ($iFlags + $Extended <> 2) Then If $sDirFilter Then If StringRegExp($sFile, $sFilter) Then $sFileList &= $sDelim & $SearchWD & $sFile Else $sFileList &= $sDelim & $SearchWD & $sFile EndIf EndIf If Not $Extended Then ContinueLoop $hWSTMP = FileFindFirstFile($sPath & $SearchWD & $sFile & "\*") If $hWSTMP = -1 Then ContinueLoop $hWSearch = $hWSTMP $SearchWD &= $sFile & "\" Else If ($iFlags + @Extended = 2) Or StringRegExp($sFile, $sFilter) = 0 Then ContinueLoop $sFileList &= $sDelim & $sFile EndIf WEnd FileClose($hSearch) If Not $sFileList Then Return SetError(3, 3, "") Return StringSplit(StringTrimLeft($sFileList, 1), "|", StringReplace(BitAND($iFlag, 32), "32", 2)) EndFunc ;==>_FileListToArrayEx
-
Hello, For my need of my application, i actually capture what i need on my network card with fiddler. But i'd like to make it automatic on my autoit script (currently getting the value by fiddler every time and putting it in my autoitscript). I have found this : http://opensource.grisambre.net/pcapau3/#download But this is only working for HTTP traffic, giving me encrypted file when i record for my HTTPS traffic (port number 443) If someone can help me out with this, thank you.
-
Hello, Same thing : My code: #pragma compile(Console, true) #AutoIt3Wrapper_Change2CUI=y ConsoleWrite("Hello World!") Right click => Compile script Still nothing on my console ^^ Edit : When i compile from Autoit, its working, what is the option when you right click => compile with option ?
-
I have tryied and this is not working : http://www.casimages.com/img.php?i=14031011461393557.png To compile, i have right click on the file .au3 and click on "compile script"
-
Hello everyone, i'dl like ot put in place something a little tricky. Here is he thing, i'd like to launch the .exe autoit on a dos windows (CMD) and get the output of my script into this window. Is it possible, any exemple ? Thank you
-
Still looking.
-
Hi, Thats not what i'm looking for. I'm looking for a loop (while/wend) that capture every request http with header while i'm navigating on the internet or in a third program tools thats use internet or HTTP request. Do you think thats possible ?
-
Hello, I would like to know if i can get the same information in autoit like i can get with fiddler 2. Exemple, when i browse the autoit Website, get back in my script the request header like that : Accept: */* Accept-Encoding: gzip,deflate,sdch Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 Origin: http://www.autoitscript.com Connection: keep-alive Is this possible (like raise an event in autoit if an http request pop)?? Thx for your help.
-
hahahah thank ou for your time. Btw, just like that, does it will still work fine (i mean fast enough) if i got like 10 000 items in my listview and i move back the 10 001 on top ?
-
Awesome. but two questions : 1 : how can i setup back a color for an item (i'm using different color every time i add an item) i did it with GUICtrlCreateListViewItem( "1", $List1) GUICtrlSetBkColor(-1, 0xFFBC00) But this is not working anymore :s 2: Is there is a way to do not select the last item every time ?