shaahin Posted October 3, 2006 Posted October 3, 2006 hi. i want to make a program that create a list structure of a drive and all of folders and files in it,then show all of them in a tree view. i wrote some code that create a list of first level of my drive and all files and folder in it, but i don't now how can do that for all subfolder and files in it. (like dir /s) sombody can help me? also i want to save this structure in a file, and next time load it to treeview! is it difficult? i am waiting... my simple code for test : =============================================== #include <GUIConstants.au3> #Include <File.au3> #Include <Array.au3> #Include <GuiTreeView.au3> $FileList=_FileListToArray("c:\","*.*",0) GUICreate("") GUISetState() $tview=GUICtrlCreateTreeView(0,0,400,400) for $i= 1 to $filelist[0] $Folder=GUICtrlCreateTreeViewItem($filelist[$i],$tview) searchinside("D:\"&$filelist[$i]&"\") Next While 1 $msg=GUIGetMsg() if $msg=$GUI_EVENT_CLOSE then Exit WEnd func searchinside($searchstring) $FileList2=_FileListToArray($searchstring,"*.*",0) if IsArray($filelist2) Then for $j=1 to $FileList2[0] $Folder2=GUICtrlCreateTreeViewItem($filelist2[$j],$Folder) Next EndIf EndFunc
Moderators SmOke_N Posted October 3, 2006 Moderators Posted October 3, 2006 Are you trying to get it to look like "FileOpenDialog"?... If so, you might take a look at FileGetAttribute(), and get ready for some string parsing fun . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
shaahin Posted October 9, 2006 Author Posted October 9, 2006 I want to make a program to save a drive structure (with all files and folders in all levels) in a text file (and also show it in a treeview) that i can load it later for compare . I need somthings like 'Folder Bar' in 'My Computer' (Include files). I can do that for first level of drive, my problem is subfolders and other levels. Sombody here can help me? I wrote a simple example (Without Save\Load Function). i Hope it help other to understand what i need. I am waiting...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now