|
-
May 18th, 2005, 06:17 PM
#1
Thread Starter
Addicted Member
Virtual folder
I have a virtual folder with images like this: "../images/files/"
I need to read the folder content, file names and count.
How do I do that?
Thank ya all!!
-
May 20th, 2005, 04:49 PM
#2
Hyperactive Member
Re: Virtual folder
Take a look at the DirectoryInfo class and FileInfo class. THose would be the place to start. If you have any questions with them, let me know and I will help where I can.
-
May 20th, 2005, 07:55 PM
#3
Thread Starter
Addicted Member
Re: Virtual folder
how does that work in virtual directory?? "../folder/subfolder/../"
-
May 20th, 2005, 09:50 PM
#4
Re: Virtual folder
you would need to use Server.MapPath()
VB Code:
Dim PhysicalPath as String = Server.MapPath("../images/files/")
Dim di as New System.IO.DirectoryInfo(PhysicalPath)
'Output a list of files
Dim Files() as System.IO.FileInfo = di.GetFiles()
Response.Write("<b> Files </b><br />")
For Each fi as FileInfo In Files
Response.Write(fi.Name & "<br />")
Next
Dim Dirs() as System.IO.DirectoryInfo = Di.GetDirectories()
Response.Write("<b> Files </b><br />")
For Each d as DirectoryInfo In Dirs
Response.Write(d.Name & "<br />")
Next
Done of the top of my head, but should work fine....
This lists all the files and then directories (if any exist)
Last edited by <ABX; May 21st, 2005 at 04:12 PM.
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
May 21st, 2005, 08:26 AM
#5
Thread Starter
Addicted Member
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
|