By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

How to loop thru all the files in a folder ?

P: n/a
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.
Apr 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 16, 9:59 am, "fniles" <fni...@pfmail.comwrote:
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

Apr 16 '07 #2

P: n/a
"rowe_newsgroups" <ro********@yahoo.comschrieb:
>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

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

Next FileName
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Apr 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.