Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 February 26th, 2007, 06:37 PM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cycle Through Files VB.NET 2003

Hi All,

I have a question regarding opening and closing files in a Windows Form written in VB.NET using VS 2003.

Currently my program automatically opens a folder C:\Upload\Folder1 and opens the Excel file that is in that folder (file1.xls). It works with this file correctly and closes it correctly.

However, Now I have a requirement to cycle through the Upload folder going into each subfolder i.e. Folder2, Folder3 etc... And in turn read each excel sheet that is in there.

For example I want my program to do the following:
Open Folder1
Read File1.xls
Open Folder2
Read File2.xls
Open Folder3
Read File3.xls

and continue going through all the folders until there are no more folders in C:\Upload

How would I go about coding this?

Thanks for your help, it is much appreciated.
Shades7_99
 
Old February 26th, 2007, 07:31 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The System.IO namespace is what you will need to use and, more specifcally, the File, FileInfo and DirectoryInfo methods contained within it.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429





Similar Threads
Thread Thread Starter Forum Replies Last Post
Run VS.NET 2003 dataset aspx files on VS 2005 cJeffreywang ASP.NET 2.0 Basics 0 October 16th, 2007 07:27 PM
Conversion from .Net 2003 to .Net 2005 using VB.Ne coleenh Visual Basic 2005 Basics 0 September 19th, 2006 02:48 PM
Can I run VB .net 2005 with DOT NET 2003 APPLICATI kadesskade BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 August 8th, 2006 05:14 AM
vb.net 2002 OR vb.net 2003 metalaaron VB.NET 2002/2003 Basics 0 August 5th, 2003 10:00 AM
vb.net 2002 - vb.net 2003 book metalaaron Wrox Book Feedback 0 August 2nd, 2003 10:46 PM





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