|
-
Nov 7th, 2001, 09:02 AM
#1
Directory/File Listing Problem
Hello,
I was asked by a friend to make a prog that will create an html file with a directory/file listing every X seconds, I used the following code and it works fine if there's only one more level under the dir but if a sub dir has a sub dir it doesn't list it, any help would be greatfully apriciated
Code:
Text1.Text = "<html><title>Download Reporter</title><body>"
For i = Dir1.ListIndex To Dir1.ListCount - 1
sFile = Dir$(Dir1.List(i) & "\*.*")
Text1.Text = Text1.Text & Dir1.List(i) & ": <br>"
Do While sFile <> ""
Text1.Text = Text1.Text & "<li>" & sFile & "</li><br>"
sFile = Dir$
Loop
Text1.Text = Text1.Text & "<br>"
Next i
Open Text2.Text For Output As #1
Print #1, Text1.Text
Print #1, "<br><br><small>Created on: " & Date & " at: " & Time & "</body></html>"
Close #1
Thanks in advance!
-
Nov 7th, 2001, 09:42 AM
#2
Fanatic Member
yeah, it won't do any more than one level. You need to loop through your sub directories, getting the names of each file and storing them in an array (or writing them directly to your text box) - This shouldn't be a problem for your code, as you are building HTML on a hierarchical basis anyway...
-
Nov 7th, 2001, 02:09 PM
#3
My question is how can I either check if a dir in a dir listbox has sub dirs and if so change to it (I can do this one) and carry on like this?
Thanks in advance!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|