Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 29th, 2005, 01:41 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default folder filter

Hi,
I have the below code that lists all the subfolders in a folder
Now how can I filter one or two folders not to show in the list???
It lists for ex these folders:
images
test
admin
myfiles

I want for ex the "admin" folder not to show up in the list


<%
    FolderCounter = 0
    SET MyFileObject = server.createobject("Scripting.FileSystemObject")
    SET MyFolder = MyFileObject.GetFolder(Folder)
    FOR EACH Folders IN MyFolder.SubFolders
        FolderName = Folders.name
        IF lcase(FolderName) <> "_vti_cnf" THEN
            image = "folder.gif"
            %>
<tr>
<td><img src='images/<%= image & "' border='0' alt='Folder: " & FolderName%>'>&nbsp;<a class='linksd' href='homePageEditor.asp?CPRN=<%= CPRN & "&CurrentDir=" & Server.URLEncode(Base64Encode(CurrentDir & "\" & FolderName)) %>'><%= FolderName %></a></td>
<td class='folderssize'><%=formatnumber(Folders.size,0 )%>&nbsp; </td>
</tr>
<%
            FolderCounter = FolderCounter + 1
        END IF
    NEXT
    SET MyFolder = nothing
    SET MyFileObject = nothing
    %>


 
Old November 30th, 2005, 06:39 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just check your FolderName variable does not equal "admin" in the same way as your are checking it is not "_vti_cnf"

HTH,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter on Certain dates DianaTokatlidis Access 5 October 22nd, 2007 09:56 AM
App_Code folder shared on only 1 folder? rpeters83 ASP.NET 2.0 Professional 1 September 1st, 2006 10:53 PM
Filter Help mcloum Classic ASP Databases 2 November 10th, 2005 05:40 PM
Making a folder virtual folder on button click in CsharpHelp C# 0 October 26th, 2005 05:57 AM
Filter Help mcloum BOOK: Beginning ASP 3.0 1 August 26th, 2005 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.