Click here to Skip to main content
15,904,926 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
here in the below coding i cant able to identify the "dirinfo " term in the coding kindly guide me with a sample

VB
For Each fi As System.IO.FileInfo In dirInfo.GetFiles("*.doc")
'  dirInfo : is the directory where all the separate docs are saved
Posted
Comments
koolprasad2003 12-Nov-11 2:01am    
what is the problem, is there any error occoured ?
ANANTH P 12-Nov-11 2:04am    
dirinfo means directory information , it s the keyword that i had given,,
how can i mention the directory path by coding

Here[^] is the MSDN page for DirectoryInfo class. This page has an excellent example on how to use it. You should book mark the MSDN Homepage[^] for future reference, and your first option, if you don't know how to do something, should always be to open that page and search for what you need. You will learn things much quicker that way, as well as learning the proper way to do things.

Hope it helps you.
 
Share this answer
 
It's simple: you need to look at the lines that are executed before the For Each statement.
Somewhere there will be the equivalent of:
VB
Dim dirInfo As New DirectoryInfo(path)
 
Share this answer
 
More to it, GetFiles returns string array, so you cannot use for each as shown in that code anyway.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900