Heyitsjoe80
asked on
Searching a File Tree
I have a program running off a CD that creates a File Tree with all the directories on the CD. There are 3 CD's in all. There are sub-directories that are numbered with 8 digits. For example, 60003451 or 70003459. These sub-directories are in all different areas in the File Tree. Is there a way to create a control that can search for the 8-digit number and take the user to that subdirectory. All I need is a text box and a button control. Nothing fancy at all. Also, if the 8-digit number that the user types in is incorrect, tell the user it's a wrong number or on another CD. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry the commented line should be:
get files in a similar way: My.Computer.FileSystem.Get Files(Star tPath, FileIO.SearchOption.Search AllSubDire ctories, Me.TextBox1.Text))
get files in a similar way: My.Computer.FileSystem.Get
and you can search with wildcards (*.txt) but you dont need that do you. :-)
My... requires DotNet2 btw (VS 2005)
If so, I'm not aware of a built-in search command for a TreeView control. You'd have to write your own looping command using a For Each ... Next to go through each node of the control, looking for a match. If you put the entire path in the Tag property for the node, you could then return the tag and move to that directory if the match is made.
If I'm pointing in the right direction but you're not sure how to handle the details, let me know and I can flesh it out. If I'm all wet, please give us a better sense of how the directory list is structured, and we can take it from there.