473,320 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Expanding File Folders

Hello All,

I have a ListView control which displays files from a remote server.
Some ListViewItems are folders which have an undetermined number of
sub-folders.

What I need to do is programatically expand all folders/sub folders and
download the files within.

Has anybody coded a function which will loop thru a folder and all
subfolders ?

Thanks in advance

Nov 21 '05 #1
3 1036
hharry,

This subprocedure loops through all the files and folders for a particular
starting folder:

Private Sub DisplayFolderInfo(ByVal folder As String)

Dim di As New DirectoryInfo(folder)
Dim fi As FileInfo

MsgBox("Folder: " & folder)

For Each fi In di.GetFiles
MsgBox("File: " & fi.FullName)
Next

Dim subDI As DirectoryInfo
For Each subDI In di.GetDirectories
DisplayFolderInfo(di.FullName & "\" & subDI.Name)
Next

End Sub

You get the process started like this:

DisplayFolderInfo("c:\TestDisplayFolders")

Kerry Moorman
"hharry" wrote:
Hello All,

I have a ListView control which displays files from a remote server.
Some ListViewItems are folders which have an undetermined number of
sub-folders.

What I need to do is programatically expand all folders/sub folders and
download the files within.

Has anybody coded a function which will loop thru a folder and all
subfolders ?

Thanks in advance

Nov 21 '05 #2
"hharry" <pa*********@nyc.com> schrieb:
I have a ListView control which displays files from a remote server.
Some ListViewItems are folders which have an undetermined number of
sub-folders.


How do you have access to the remote server?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3
All set..thanks

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: TaeKyon | last post by:
I'm a python newbie; here are a few questions relative to a problem I'm trying to solve; I'm wandering if python is the best instrument or if awk or a mix of bash and sed would be better: 1) how...
8
by: Mr. B | last post by:
I'm writing an app where I'm trying to look for and List all specific file 'types' found. So I point to a specific start top level Folder... and I want to drill down through ALL sub folders to...
10
by: Jon Maz | last post by:
Hi, Curiosity - when you right-click on a file in the VS.Net Solution Explorer and select "Exclude from Project", it continues to be shown in the Solution Explorer as a sort of ghostly outline...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
3
by: Silvester | last post by:
I need to trigger some code when user drags and drops an entire folder onto my form. How can I distinguish between a folder drop and files dropped ? Can someone point me to code or a sample,...
1
by: Rahsaan Page | last post by:
Hello Everybody, I am trying to write a file Explorer program in Java, i go the Frame, Basic Menu and Tree going. But now i have the C: listed and i need some help expanding and collaping the...
2
by: Jeff | last post by:
....hope this question is on the right ng. The code below works to copy all files and folders from D:\Template to a new location that is specified by the user. Is there any easy way to modify...
1
by: veer | last post by:
hi it looks a silly question but i m getting confused actually i want to copy folders from one location to another like from C:\abc To D:\xyz here abc and xyz are two folders in c and d drive it...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.