Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 10th, 2005, 02:52 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Read Files from Folder using "FileSystemObject"

Say in particular foler, there are so many files, i want read each and every file one by one from specific foler, how can we do that??

 i have just read only one file by taking first file as a string and declared as a default file, code is like below:

================================================== ===============

Dim f as New Scripting.FileSystemObject
Dim file As Scripting.File
Dim folder As Scripting.Folder
Dim DefaultFile As String
Dim MyFile As String



Set Folder = f.GetFolder("C:\Temp")
DefaultFile = "somefile"
FindFile = DefaultFile & ".txt"

If f.FileExists(folder.Path & "\" & MyFile) Then

    //do something for first file
end if
================================================== ===============

  If there are 5 files in folder, then it should read one-by-one... ANY IDEAS ??

~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
__________________
~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
Reply With Quote
  #2 (permalink)  
Old December 10th, 2005, 06:43 AM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let it be, I've fix it, using .Files property of SystemFileObject ...

~ ~ ~ There is no Right, There is no Wrong, KNOWLEDGE is Only the POWER ~ ~ ~
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort the files in folder abhisheksud BOOK: Beginning Java 2 1 February 11th, 2007 08:49 PM
How to Zip files within a folder Udi C# 2 January 24th, 2007 11:45 PM
save files into a folder jessiang General .NET 3 January 16th, 2006 08:48 AM
FILES in FOLDER luma SQL Server DTS 0 June 9th, 2005 01:53 AM
Create/Delete files w/ASP using FileSystemObject John K. King Classic ASP Basics 3 August 17th, 2003 06:53 PM



All times are GMT -4. The time now is 03:52 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.