How to loop thru all the files in a folder ?

F

fniles

I would like to loop thru all the files in a folder. For ex: I have a folder
c:\temp and inside that folder there are many zip files. I want to read each
zip files in c:\temp.
How can I do that ?
Thank you.
 
R

rowe_newsgroups

I would like to loop thru all the files in a folder. For ex: I have a folder
c:\temp and inside that folder there are many zip files. I want to read each
zip files in c:\temp.
How can I do that ?
Thank you.

Something like:

for each file as System.IO.File in System.IO.Directory.GetFiles("C:
\temp", "*.zip")
' Do Something
end for

Thanks,

Seth Rowe
 
H

Herfried K. Wagner [MVP]

rowe_newsgroups said:
Something like:

for each file as System.IO.File in System.IO.Directory.GetFiles("C:
\temp", "*.zip")
' Do Something
end for


\\\
Imports System.IO
....
For Each FileName As String In Directory.GetFiles("C:\temp", "*.zip")

Next FileName
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top