mariostrife
22.02.2006, 09:58
Hi Leute bin neu hier und brauche unbedingt eure Hilfe! Bin noch blutiger Anfänger in ASP also habt rücksicht mit mir! :rolleyes:
Also zum Thema, ich will ein tool schreiben das mir die Ordnerstruktur eines Webspaces ausgibt und die enthaltenden Dateien verlinkt. Dazu habe ich schon folgendes tool geschrieben:
<%
Dim InputPathDirectory(99999), i, test2
i = 0
InputPath = Server.MapPath("./")
Call ListSubFolders( InputPath )
Public Sub ListSubFolders( InputPath )
Set objFileSys = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder(InputPath)
Set objSubFolders = objFolder.SubFolders
For Each Folder in objSubFolders
Response.Write "<h3>" & Folder.Name & "</h3><br>"
InputPathDirectory(i) = Folder.Name & "/"
Call ListFolder( Server.MapPath("./" & Folder.Name) )
'Response.Write Server.MapPath("./" & Folder.Name)
'Call ListSubFolders ( Server.MapPath("./" & Folder.Name) )
'InputPath = Folder.Name
i = i + 1
Next
Set objSubFolders = Nothing
Set objFolder = Nothing
Set objFileSys = Nothing
End Sub
Public Sub ListFolder(InputPath)
Set objFileSys = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder(InputPath)
Set objFiles = objFolder.Files
For Each File in objFiles
Response.Write "<p><a class=""pdf"" href=""" & InputPathDirectory(i) & File.Name & """>" & File.Name & "</a></p>" & vbCrLf
Next
Set objFiles = Nothing
Set objFolder = Nothing
Set objFileSys = Nothing
End Sub
%>
das tool zeigt auch die Ordner und die enthaltenden Dateien richtig an, nur unterordner und deren Dateien werden einfach nicht beachtet.
Kann mir jemand sagen was ich falsch mache?
Also zum Thema, ich will ein tool schreiben das mir die Ordnerstruktur eines Webspaces ausgibt und die enthaltenden Dateien verlinkt. Dazu habe ich schon folgendes tool geschrieben:
<%
Dim InputPathDirectory(99999), i, test2
i = 0
InputPath = Server.MapPath("./")
Call ListSubFolders( InputPath )
Public Sub ListSubFolders( InputPath )
Set objFileSys = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder(InputPath)
Set objSubFolders = objFolder.SubFolders
For Each Folder in objSubFolders
Response.Write "<h3>" & Folder.Name & "</h3><br>"
InputPathDirectory(i) = Folder.Name & "/"
Call ListFolder( Server.MapPath("./" & Folder.Name) )
'Response.Write Server.MapPath("./" & Folder.Name)
'Call ListSubFolders ( Server.MapPath("./" & Folder.Name) )
'InputPath = Folder.Name
i = i + 1
Next
Set objSubFolders = Nothing
Set objFolder = Nothing
Set objFileSys = Nothing
End Sub
Public Sub ListFolder(InputPath)
Set objFileSys = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileSys.GetFolder(InputPath)
Set objFiles = objFolder.Files
For Each File in objFiles
Response.Write "<p><a class=""pdf"" href=""" & InputPathDirectory(i) & File.Name & """>" & File.Name & "</a></p>" & vbCrLf
Next
Set objFiles = Nothing
Set objFolder = Nothing
Set objFileSys = Nothing
End Sub
%>
das tool zeigt auch die Ordner und die enthaltenden Dateien richtig an, nur unterordner und deren Dateien werden einfach nicht beachtet.
Kann mir jemand sagen was ich falsch mache?